Multiple sender identities (composing)
Thomas Jost
schnouki at schnouki.net
Mon May 16 11:03:34 PDT 2011
On Mon, 16 May 2011 09:52:32 -0700, Jameson Graef Rollins <jrollins at finestructure.net> wrote:
> On Mon, 16 May 2011 11:52:43 +0200, Thomas Jost <schnouki at schnouki.net> wrote:
> > On Mon, 16 May 2011 19:29:07 +1000, Stewart Smith <stewart at flamingspork.com> wrote:
> > > Thought I'd share this bit of my .emacs snippet that may be useful to go
> > > on the emacs tips page.
> > >
> > > This does the following:
> > > - sets up a list of possible identities to have mail From
> > > - on composing mail, it prompts you for who you want to send mail from
> > > - pressing enter will give you the default (first in the list)
> > > - otherwise you have tab completion
>
> This is great, guys. I've been wanting to get something like this
> working for a while now.
>
> Have you guys looked at home message-mode does bbdb address completion
> in the To: and From: headers? It has the nice benefit of being able to
> tab through all full addresses for a bbdb entry. It would be nice to
> have this function fill in a default address, with the cursor at the end
> of the address, and then just tab through all the options without having
> to type in anything. ido is pretty cool, though, and accomplishes a
> similar effect.
I don't know much about bbdb; right now I'm completing addresses with
notmuch-address.el and a little Python script that I wrote [1]. It can
complete the From header too, although I had never tried that before
writing this mail :)
> It would be nice to pull the addresses from the notmuch config, eg:
>
> notmuch config get user.primary_email
> notmuch config get user.other_email
Nice idea, I like that. However this way you can only get the address
part, not the username part. And when using some addresses I want to put
a nickname instead of my full name, so just using a default user name is
not very convenient.
Or is it possible to put things like "User Name <me at myself.com>" in the
notmuch config?
> I would ideally like to be able to choose the From: address right before
> sending, as opposed to right before composing. Has anyone tried to get
> that working? I was not having much luck with send-hooks, since it
> looks like it expects the message to be complete at that point.
I haven't tried that, but it would indeed be nice to be able to do that
at send time.
The message-seend-hook doc states that "this hook is run quite early
when sending", so I would expect that to be the best solution.
However, if for some reason it doesn't work, it's probably possible to
write a little function around message-send (...or even to advise it) to
do whatever you want before it is actually executed.
I'll try to have a look at this tomorrow.
Regards,
Thomas
[1] https://github.com/Schnouki/dotfiles/blob/master/notmuch/addrbook.py
--
Thomas/Schnouki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20110516/a28dee05/attachment.pgp>
More information about the notmuch
mailing list