On Mon, 16 May 2011 19:29:07 +1000, Stewart Smith <stew...@flamingspork.com> 
> Thought I'd share this bit of my .emacs snippet that may be useful to go
> on the emacs tips page.

Hi Stewart,

Thanks for sharing this functionality.

I've wanted something like this, but I'm extremely reluctant to put
fancy things like this in my .emacs file. The problem I have is that I
don't want to restrict nice features to the people who manage to
configure their emacs "just so".

I'd much rather have this functionality inside notmuch itself, and
without requiring any configuration (by default).

I'll reply with a patch I just wrote attempting to implement that. By
default, it generates the list of addresses by looking in your notmuch
configuration file. It also provides a customizable list of addresses
that the user can provide (notmuch-identities).

The patch doesn't make all new composition buffers prompt for the
address. Instead, the original 'm' key does no prompting as its always
done. And a new 'M' key prompts.

I did use ido-completing-read rather than completing-read. I did that
because otherwise it's a pain to complete addresses. For example,
imagine I have the following:

        Carl Worth <cwo...@cworth.org>
        Carl Worth <carl.d.wo...@intel.com>
        Carl Worth <carl.d.wo...@gmail.com>

To select my intel address hit "C [TAB]", "a [TAB]", "i [TAB]" which is
random enough that I can't memorize it but have to instead slowly watch.

With ido I can just type "intel [ENTER]" which is nice and quick (and I
can get trained to type less if sufficient.

One thing I don't like about ido is that the input area is extremely
cluttered from the beginning with all the possible inputs. I wish it
instead waiting for some explicit keypress (such as pressing ENTER while
the input is still ambiguous) before displaying possible matches.

I don't know what trouble you had with ido on Ubuntu, but hopefully you
can work that out.

I did implement support for completion history.

I did not implement support for doing completion when forwarding.

A nice addition would be an easy keybinding for doing the same
completion to change the From header while composing a message.

Anyway, I'm throwing this out for feedback, testing, and
suggestions. Please let me know if you try and out and if you think we
should push this code.


Attachment: pgpzPE712iFHg.pgp
Description: PGP signature

notmuch mailing list

Reply via email to