Re: Address Completion in Emacs

2023-12-08 Thread David Wen Riccardi-Zhu
Thank you, Sandra! With your advice, I was able to figure out that corfu
was overriding the Tab key from notmuch. If I disable it,
notmuch-address-expand-name works (with orderless and vertico). I'll see
if I can find a way to pipe it into corfu somehow.

Sandra Snan  writes:

> David, I have message-completion-alist set to this value:
>
> (("^\\(Resent-\\)?\\(To\\|B?Cc\\|Reply-To\\|From\\|Mail-Followup-To\\|Mail-Copies-To\\):"
>  
>   .  notmuch-address-expand-name) 
>  ("^\\(Newsgroups\\|Followup-To\\|Posted-To\\|Gcc\\):" . 
>  message-expand-group) ("^\\([^ :]*-\\)?\\(To\\|B?Cc\\|From\\):" . 
>  message-expand-name)) 
>
> That way, when I hit tab in the sender field, which is bound to 
> message-tab, it'll run notmuch-address-expand-name which can find 
> pretty much everyone I've ever heard of.
>
> I additionally have an old BBDB that I've been using for ages that 
> I can access with ESC TAB which is set to bbdb-complete-mail but I 
> literally only have 16 people in there (I just checked). I use 
> them for my most common faves so I can get their most canonical 
> address with just a few letters.
>
> As for weeding through the list of candidates, there are packages 
> such as orderless and vertico that can enhance all calls to 
> completing-read, including the one in notmuch-address-expand-name. 
> After using it a while it does a good job at giving me the 
> relevantest ones at the top and letting me filter through them 
> further.
>
> Corfu and company-mode, I have never heard of! So this is more of 
> an answer to the "alternatively" part you asked.
>
> Sandra
>
>
> David Wen Riccardi-Zhu  writes:
>
>> Hello,
>>
>> I had working address completion in Emacs with company-mode, but
>> recently switched to corfu. Has anyone been able to get address
>> completion to work with it?
>>
>> Alternatively, I'm wondering how the internal completion style works. Is
>> there a function I can call to get internal address completion to kick
>> in?
>>
>> Lastly, is it possible to remove addresses from the list of candidates?
>> I have a few addresses that were consistently recommended even though
>> they had typos in them.
>>
>> I have this in my config:
>>
>> (setq notmuch-address-command 'internal
>>   notmuch-address-internal-completion '(sent nil)
>>   notmuch-address-save-filename "~/org/contacts/notmuch-contacts"
>>   ;; ... 
>> )
>>
>> Can I manually clean up my notmuch-contacts file? 
>>
>> If yes, is it possible to add newlines to the file, to make it easier to
>> search and edit?
>>
>> Thank you!
>>
>> David
>>
>> -- 
>> dwrz|朱为文
>> ___
>> notmuch mailing list -- notmuch@notmuchmail.org
>> To unsubscribe send an email to notmuch-le...@notmuchmail.org

-- 
dwrz|朱为文
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Address Completion in Emacs

2023-12-08 Thread David Wen Riccardi-Zhu
Hello,

I had working address completion in Emacs with company-mode, but
recently switched to corfu. Has anyone been able to get address
completion to work with it?

Alternatively, I'm wondering how the internal completion style works. Is
there a function I can call to get internal address completion to kick
in?

Lastly, is it possible to remove addresses from the list of candidates?
I have a few addresses that were consistently recommended even though
they had typos in them.

I have this in my config:

(setq notmuch-address-command 'internal
  notmuch-address-internal-completion '(sent nil)
  notmuch-address-save-filename "~/org/contacts/notmuch-contacts"
  ;; ... 
)

Can I manually clean up my notmuch-contacts file? 

If yes, is it possible to add newlines to the file, to make it easier to
search and edit?

Thank you!

David

-- 
dwrz|朱为文
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


notmuch-emacs notmuch-tag configuration

2021-06-15 Thread David Wen Riccardi-Zhu
I'm using notmuch 0.32.1, Emacs 27.2, and version 20210605.1839 of
notmuch-emacs. When I try to mark a message as read using a custom
keybinding, I'm getting the following error:

notmuch-tag: Symbol’s function definition is void: query

Here's the backtrace:

Debugger entered--Lisp error: (void-function query)
  query("(id:pX7JAnfzR_GtdCfx1KGqCA@geopod-ismtpd-4-0)")
  notmuch-tag("(id:pX7JAnfzR_GtdCfx1KGqCA@geopod-ismtpd-4-0)" ("-new"
"-unread"))
  notmuch-search-tag(("-new" "-unread"))
  (lambda nil "unmark message as new and unread" (interactive)
(notmuch-search-tag (list "-new" "-unread")) (forward-line))()
  funcall-interactively((lambda nil "unmark message as new and unread"
(interactive) (notmuch-search-tag (list "-new" "-unread")) (forward-line)))
  call-interactively((lambda nil "unmark message as new and unread"
(interactive) (notmuch-search-tag (list "-new" "-unread")) (forward-line))
nil nil)
  command-execute((lambda nil "unmark message as new and unread"
(interactive) (notmuch-search-tag (list "-new" "-unread")) (forward-line)))

And following is my notmuch-emacs configuration:

(with-eval-after-load 'notmuch
  (customize-set-variable 'notmuch-search-oldest-first nil)
  (setq notmuch-address-command 'internal
notmuch-address-internal-completion '(sent nil)
notmuch-address-save-filename "~/some/dir/file"
notmuch-address-use-company t
notmuch-crypto-process-mime t
notmuch-fcc-dirs "sent"
notmuch-hello-hide-tags '("killed"))
  ;; Search tags
  (setq notmuch-saved-searches
'((:name "inbox" :query "tag:inbox" :key "i")
  (:name "unread" :query "tag:unread" :key "u")
  (:name "new" :query "tag:new" :key "n")
  (:name "sent" :query "tag:sent" :key "e")
  (:name "drafts" :query "tag:draft" :key "d")
  (:name "all mail" :query "*" :key "a")
  (:name "todo" :query "tag:todo" :key "t")))
  ;; Keybindings
  (define-key notmuch-search-mode-map "S"
(lambda ()
  "mark message as spam"
  (interactive)
  (notmuch-search-tag (list "-new" "-unread" "-inbox" "+spam"))
  (forward-line)))
  (define-key notmuch-show-mode-map "S"
(lambda ()
  "mark message as spam"
  (interactive)
  (notmuch-show-tag (list "-new" "-unread" "-inbox" "+spam"
  (define-key notmuch-search-mode-map "N"
(lambda ()
  "unmark message as new and unread"
  (interactive)
  (notmuch-search-tag (list "-new" "-unread"))
  (forward-line)))
  (define-key notmuch-show-mode-map "N"
(lambda ()
  "unmark message as new and unread"
  (interactive)
  (notmuch-show-tag (list "-new" "-unread"
  (define-key notmuch-show-mode-map "r" 'notmuch-show-reply)
  (define-key notmuch-show-mode-map "R" 'notmuch-show-reply-sender)
  (define-key notmuch-search-mode-map "r" 'notmuch-search-reply-to-thread)
  (define-key notmuch-search-mode-map "R"
'notmuch-search-reply-to-thread-sender))

I'm a little confused as to why this isn't working -- I don't believe that
my configuration has strayed from what's listed in the online documentation.

Any insights? I don't know Emacs Lisp well enough to understand why query
is a void function.

Many thanks!

David
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: Address Completion No Longer Working

2018-03-15 Thread david wen riccardi-zhu

Hi David,

My apologies if I am missing something obvious, but I'm getting 
the following:


Cannot find notmuch-emacs source directory

I've tried running the script from both my home directory and my 
.emacs.d. The script states:


;; Try the notmuch emacs client located in ../emacs/ directory

I'm not sure which directory this is referring to.

Thanks again for your time!
David

David Bremner <da...@tethera.net> writes:

david wen riccardi-zhu <d...@dwrz.net> writes: 



Is what I'm seeing potentially a misconfiguration, or bug in 
company-mode? 

The last customizations I made to my init was editing my 
text-mode-hook (where I did specify some company-backends) and 
then just some minor counsel and ripgrep related changes. I 
haven't touched my notmuch-related config in some time. However 
I don't have my init under version control, and it is a mess, 
so perhaps I'm missing something. : ( FWIW, fish is also not a 
recent development. 


The obvious thing to try is try-emacs-mua script from the source 
(attached) 

This will let you use company without any of your personal 
configuration. Run as e.g. "sh ./try-emacs-mua -q" 
 


--
dwrz|朱为文
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: Address Completion No Longer Working

2018-03-12 Thread david wen riccardi-zhu
Thanks, Tomi. So far, I can confirm that completion works with 
emacs -Q, but not with company. I'm looking into that more now.


Tomi Ollila <tomi.oll...@iki.fi> writes:

On Sun, Mar 11 2018, david wen riccardi-zhu wrote: 

Address completion worked out of the box for me with notmuch 
and Emacs. Recently, it's stopped working. I've tried setting 
notmuch-address-command to internal, as well as toggling 
notmuch-address-toggle-internal-completion, but neither has 
been able to return the functionality. 

I am able to get notmuch address to work on the command line. 

I use: Arch Linux X86-64, Kernel 4.15.7-1-ARCH fish shell 
notmuch 0.26 Emacs 25.3.1 company-mode 

Any insights on how I might get autocompletion working again? 


Try running emacs -Q to remove the potential effect of your own 
configuration files (if you have notmuch cloned you can also try 
to execude ./devel/try-emacs-mua to do that). 

If problem persists, resend your issue w/ updated information. 

Tomi 

-- dwrz|朱为文 


--
dwrz|朱为文
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: Address Completion No Longer Working

2018-03-12 Thread david wen riccardi-zhu

Thanks so much for your time and the suggestions.

- try running (notmuch-address-matching "dwrz") in *scratch* (or 
IELM, 
  or M-:) ; this will eliminate company-mode as a suspect, and 
  potentially give you a traceback if something is going wrong. 


I can confirm this works in IELM and M-:.

- have a look at the variable notmuch-address-save-filename. 
Potentially 
  set it (back) to nil to disable persistent caching. If that 
  fixes it, have a look at the corresponding file, see if 
  something corrupted it.


This was not set to anything, but set or unset, it seems to make 
no difference.


What does seem to make a difference is toggling 
notmuch-address-use-company. Without it, tab completion seems to 
work in message mode, although it's not very useful. With it on, I 
get no completion.


Is what I'm seeing potentially a misconfiguration, or bug in 
company-mode?


The last customizations I made to my init was editing my 
text-mode-hook (where I did specify some company-backends) and 
then just some minor counsel and ripgrep related changes. I 
haven't touched my notmuch-related config in some time. However I 
don't have my init under version control, and it is a mess, so 
perhaps I'm missing something. : ( FWIW, fish is also not a recent 
development.


David Bremner <da...@tethera.net> writes:

david wen riccardi-zhu <d...@dwrz.net> writes: 

Address completion worked out of the box for me with notmuch 
and Emacs. Recently, it's stopped working. I've tried setting 
notmuch-address-command to internal, as well as toggling 
notmuch-address-toggle-internal-completion, but neither has 
been able to return the functionality. 


"stopped working" usually suggests some configuration change to 
me. It would be helpful to know what precisely changed. 

As far as debugging, I had two ideas to try. 

- try running (notmuch-address-matching "dwrz") in *scratch* (or 
IELM, 
  or M-:) ; this will eliminate company-mode as a suspect, and 
  potentially give you a traceback if something is going wrong. 

- have a look at the variable notmuch-address-save-filename. 
Potentially 
  set it (back) to nil to disable persistent caching. If that 
  fixes it, have a look at the corresponding file, see if 
  something corrupted it. 

I use: Arch Linux X86-64, Kernel 4.15.7-1-ARCH fish shell 


fish breaks lots of assumptions for shells, but I guess you 
didn't just switch. 

notmuch 0.26 


some subtle things changed with respect to starting external 
processes in notmuch 0.26; if your recent configuration change 
was upgrading notmuch, that might be worth further 
investigation. 



--
dwrz|朱为文
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Address Completion No Longer Working

2018-03-11 Thread david wen riccardi-zhu
Address completion worked out of the box for me with notmuch and 
Emacs. Recently, it's stopped working. I've tried setting 
notmuch-address-command to internal, as well as toggling 
notmuch-address-toggle-internal-completion, but neither has been 
able to return the functionality.


I am able to get notmuch address to work on the command line.

I use:
Arch Linux X86-64, Kernel 4.15.7-1-ARCH
fish shell
notmuch 0.26
Emacs 25.3.1
company-mode

Any insights on how I might get autocompletion working again?
--
dwrz|朱为文
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: Emacs "notmuch CLI version mismatch"

2017-07-10 Thread david wen riccardi-zhu
Thanks so much, David.

> At a guess, you are using git master of the emacs client (perhaps via
> melpa, or via some arch git snapshot package), and a released version of
> the notmuch binary.

I am using MELPA -- does this mean I should be using git to get the
binary?

> What is the output of M-x notmuch-hello-versions 

notmuch version 0.24.2

---
dwrz|朱为文 

On 2017-07-10 18:14, David Bremner wrote:

> david wen riccardi-zhu <d...@dwrz.net> writes:
> 
>> I'm getting this error in Emacs after upgrading packages:
>> 
>> notmuch-logged-error: notmuch CLI version mismatch Emacs requested 
>> a newer output format than supported by the notmuch CLI.  You may 
>> need to restart Emacs or upgrade your notmuch package.
> 
> At a guess, you are using git master of the emacs client (perhaps via
> melpa, or via some arch git snapshot package), and a released version of
> the notmuch binary. 
> 
>> The message appears whenever I try to open an email. 
>> 
>> Emacs is 25.2.1, notmuch is 0.24.2. I'm on Arch Linux x86_64.
> 
> What is the output of M-x notmuch-hello-versions 
> 
>> Am I getting this error because Arch needs to update to 0.24.2-2? 
>> Should I switch to git?
> 
> 0.24.2-2 is not an upstream version of notmuch; there is a Debian
> version like that; perhaps arch has a similar versioning scheme. 
> 
>> It would also be nice if this error didn't prevent accessing 
>> messages. : )
> 
> In general this message indicates your emacs lisp components and your
> notmuch binary have drifted dangerously far apart in versions, and you
> should really fix that problem. You can still use the command line
> "notmuch search" and "notmuch show" commands for access to your mail in
> the meantime.
> 
> d___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Emacs "notmuch CLI version mismatch"

2017-07-10 Thread david wen riccardi-zhu

I'm getting this error in Emacs after upgrading packages:

notmuch-logged-error: notmuch CLI version mismatch Emacs requested 
a newer output format than supported by the notmuch CLI.  You may 
need to restart Emacs or upgrade your notmuch package.


The message appears whenever I try to open an email. 


Emacs is 25.2.1, notmuch is 0.24.2. I'm on Arch Linux x86_64.

I've tried upgrading my OS, and restarting Emacs and the OS, but 
the error persists.


Am I getting this error because Arch needs to update to 0.24.2-2? 
Should I switch to git?


It would also be nice if this error didn't prevent accessing 
messages. : )


Many thanks!
--
dwrz|朱为文
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


notmuch-show-view-part does nothing

2017-07-05 Thread david wen riccardi-zhu
On Arch Linux x86_64, using Emacs 25.2.1, notmuch-show-view-part does
nothing.

Any suggestions on how I can fix this?
-- 
dwrz|朱为文
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


format-flowed in compose mode

2017-01-05 Thread david wen riccardi-zhu
I'm not a developer and I'm still rather new to Emacs.

Also, as far as I understand, notmuch uses gnus for compose mode.

But I'm stuck and wondering if anyone has a solution:

When sending mail from Emacs, the text does not appear to respect line
breaks when read on a mobile phone. Instead, there appear to be random
line breaks in the text, which makes reading emails rather frustrating.

My understanding is that some time ago, an RFC was passed to make email
compatible for viewing on mobile devices. This solution is
format=flowed. For background, see: http://joeclark.org/ffaq.html

I've been trying to implement this solution in gnus, but haven't come across a 
solution.

Google suggests I'm not the only one experiencing this issue, see:
http://stackoverflow.com/questions/41299350/how-can-i-send-messages-with-format-flowed-with-the-notmuch-message-client
https://www.reddit.com/r/emacs/comments/55ydkd/gnus_and_formatflowed/

The EmacsWiki has a page on gnus and format=flowed, but I've found it pretty 
hard to decipher:
https://www.emacswiki.org/emacs/GnusFormatFlowed.

The wiki suggests that format-flowed is enabled in gnus, which doesn't
seem to make sense with my experience so far.

It also suggests that "if you want dynamic reflowing, simply unfold encoded
lines to full length and setup article buffers to wrap."

I have no idea what this means (see the reddit thread for more
confusion).

It also seems to suggest using use-hard-newlines, while at the same time
suggesting that it makes no difference. I actually gave this a shot, and
the wiki was right: it made no difference.

My only remaining lead is that perhaps the issue isn't with gnus at all,
but with my smtp client, msmtp. See:
https://github.com/djcb/mu/issues/569. It's from the mu github, but
assuming mu4e also uses gnus and/or doesn't "send the mail", then perhaps
that's a potential answer.

To recap:
1. If notmuch handles composition, then this is either a bug report or a
feature request.
2. If notmuch does not handle composition, I'd appreciate insight from
anyone who has managed to resolve this issue.
3. Or, any hints as to whether it's worth sending this email to the
gnus/emacs/msmtp mailing lists.

Thanks!

David

-- 
dwrz|朱为文
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: Search -- Display Recent Dates First

2016-12-28 Thread david wen riccardi-zhu
Thank you very much, Tomas! Both are working for me now.

---
dwrz|朱为文 

On 2016-12-27 18:24, Tomas Nordin wrote:

> David Wen Riccardi-Zhu <d...@dwrz.net> writes:
> 
>> When I run a search with notmuch (on Emacs), olders email are shown first
>> (at the top of the screen). This is inconvenient, since the majority of
>> my searches relate to more recent emails. Is there a way to flip the
>> output around, so that newer mails appear first?
> 
> Check out the variable notmuch-search-oldest-first. I have this set in
> my notmuch-config:
> 
> (setq notmuch-search-oldest-first t)
> 
> you should have
> 
> (setq notmuch-search-oldest-first nil)
> 
> I guess. Also, in a notmuch-search buffer, the effect of pressing o for
> me is to toggle the search order. C-h k o
> 
> o runs the command notmuch-search-toggle-order, which is an
> interactive compiled Lisp function in `notmuch.el'.
> 
> It is bound to o.
> 
> (notmuch-search-toggle-order)
> 
> Toggle the current search order.___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Search -- Display Recent Dates First

2016-12-27 Thread David Wen Riccardi-Zhu
When I run a search with notmuch (on Emacs), olders email are shown first
(at the top of the screen). This is inconvenient, since the majority of
my searches relate to more recent emails. Is there a way to flip the
output around, so that newer mails appear first?

FYI: I'm not a developer. : [

-- 
dwrz|朱为文
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch