unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Multiple sender identities (composing)
@ 2011-05-16  9:29 Stewart Smith
  2011-05-16  9:52 ` Thomas Jost
                   ` (2 more replies)
  0 siblings, 3 replies; 35+ messages in thread
From: Stewart Smith @ 2011-05-16  9:29 UTC (permalink / raw)
  To: notmuch

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

You may also want to set this:
 '(message-sendmail-envelope-from (quote header))
(in custom-set-variables) so that if you're doing postfix sender based routing
or the like, it gets the correct address and doesn't end up sending
things the wrong way.

(setq stewart/mua-identities (list "Stewart Smith <stewart@flamingspork.com>" "Stewart Smith <stewart.smith@percona.com>"))

(defun stewart/notmuch-mua-mail (&optional from)
  (interactive)
  (setq from (completing-read "Sender identity: " stewart/mua-identities
		   nil t nil nil (car stewart/mua-identities)))
  (notmuch-mua-mail nil nil (list (cons 'from from))))

(define-key notmuch-show-mode-map "m"
      (lambda ()
        "send email"
        (interactive)
	(stewart/notmuch-mua-mail)))

(define-key notmuch-search-mode-map "m"
      (lambda ()
        "send email"
        (interactive)
	(stewart/notmuch-mua-mail)))

-- 
Stewart Smith

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: Multiple sender identities (composing)
  2011-05-16  9:29 Multiple sender identities (composing) Stewart Smith
@ 2011-05-16  9:52 ` Thomas Jost
  2011-05-16 13:52   ` Stewart Smith
  2011-05-24 21:54 ` Carl Worth
  2011-06-01  5:53 ` Brian May
  2 siblings, 1 reply; 35+ messages in thread
From: Thomas Jost @ 2011-05-16  9:52 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 1748 bytes --]

On Mon, 16 May 2011 19:29:07 +1000, Stewart Smith <stewart@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

And here's the same for choosing the identity when forwarding a mail:

;; Choose the identity used to forward a mail
(defun schnouki/notmuch-mua-forward-message ()
  (interactive)
  (let* ((from (ido-completing-read "Sender identity: " schnouki/mua-identities
				    nil nil nil nil (car schnouki/mua-identities)))
	 (address-components (mail-extract-address-components from))
	 (user-full-name (car address-components))
	 (user-mail-address (cadr address-components)))
    (notmuch-mua-forward-message)))

(people who don't use or like ido may want to replace
ido-completing-read with completing-read)

If anyone is interested, I have some more useful snippets available on
https://github.com/Schnouki/dotfiles/blob/master/emacs/init-50-mail.el#L232:
- function to choose a signature according to the From header
- function to choose the sender identity according to the To header
  (useful for replying to work e-mails using your work address, or for
  replying to a ML with a subscribed address that won't be rejected)
- function to change the SMTP server that will be used for sending the
  mail according to the From header

It seriously lacks documentation so don't hesitate to ask if you have
any problem with it :)

Regards,

-- 
Thomas/Schnouki

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: Multiple sender identities (composing)
  2011-05-16  9:52 ` Thomas Jost
@ 2011-05-16 13:52   ` Stewart Smith
  2011-05-16 16:52     ` Jameson Graef Rollins
  0 siblings, 1 reply; 35+ messages in thread
From: Stewart Smith @ 2011-05-16 13:52 UTC (permalink / raw)
  To: Thomas Jost, notmuch

On Mon, 16 May 2011 11:52:43 +0200, Thomas Jost <schnouki@schnouki.net> wrote:
> On Mon, 16 May 2011 19:29:07 +1000, Stewart Smith <stewart@flamingspork.com> wrote:
> (people who don't use or like ido may want to replace
> ido-completing-read with completing-read)

I couldn't get ido to work at all (Ubuntu Natty). It would just prompt
and not tab complete or even accept enter (it would insert a newline in
minibuffer) - which is why I just ended up using completing-read.

> - function to change the SMTP server that will be used for sending the
>   mail according to the From header

I actually just do this via postfix sender_dependent_relayhost_maps
which ends up working quite nicely.


-- 
Stewart Smith

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: Multiple sender identities (composing)
  2011-05-16 13:52   ` Stewart Smith
@ 2011-05-16 16:52     ` Jameson Graef Rollins
  2011-05-16 18:03       ` Thomas Jost
                         ` (2 more replies)
  0 siblings, 3 replies; 35+ messages in thread
From: Jameson Graef Rollins @ 2011-05-16 16:52 UTC (permalink / raw)
  To: Stewart Smith, Thomas Jost, notmuch

[-- Attachment #1: Type: text/plain, Size: 1549 bytes --]

On Mon, 16 May 2011 11:52:43 +0200, Thomas Jost <schnouki@schnouki.net> wrote:
> On Mon, 16 May 2011 19:29:07 +1000, Stewart Smith <stewart@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.

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

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.

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: Multiple sender identities (composing)
  2011-05-16 16:52     ` Jameson Graef Rollins
@ 2011-05-16 18:03       ` Thomas Jost
  2011-05-16 18:43         ` Jameson Graef Rollins
  2011-05-16 22:36       ` green
  2011-05-17  4:38       ` Mueen Nawaz
  2 siblings, 1 reply; 35+ messages in thread
From: Thomas Jost @ 2011-05-16 18:03 UTC (permalink / raw)
  To: Jameson Graef Rollins, Stewart Smith, notmuch

[-- Attachment #1: Type: text/plain, Size: 2849 bytes --]

On Mon, 16 May 2011 09:52:32 -0700, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> On Mon, 16 May 2011 11:52:43 +0200, Thomas Jost <schnouki@schnouki.net> wrote:
> > On Mon, 16 May 2011 19:29:07 +1000, Stewart Smith <stewart@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@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

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: Multiple sender identities (composing)
  2011-05-16 18:03       ` Thomas Jost
@ 2011-05-16 18:43         ` Jameson Graef Rollins
  0 siblings, 0 replies; 35+ messages in thread
From: Jameson Graef Rollins @ 2011-05-16 18:43 UTC (permalink / raw)
  To: Thomas Jost, Stewart Smith, notmuch

[-- Attachment #1: Type: text/plain, Size: 454 bytes --]

On Mon, 16 May 2011 20:03:34 +0200, Thomas Jost <schnouki@schnouki.net> wrote:
> 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@myself.com>" in the
> notmuch config?

notmuch config get user.name

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: Multiple sender identities (composing)
  2011-05-16 16:52     ` Jameson Graef Rollins
  2011-05-16 18:03       ` Thomas Jost
@ 2011-05-16 22:36       ` green
  2011-05-17  4:38       ` Mueen Nawaz
  2 siblings, 0 replies; 35+ messages in thread
From: green @ 2011-05-16 22:36 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 328 bytes --]

Jameson Graef Rollins wrote at 2011-05-16 11:52 -0500:
> This is great, guys.  I've been wanting to get something like this
> working for a while now.

Yes; thanks Stewart, Thomas.  This is one thing that has slowed my transition 
to notmuch (from Mutt).

Perhaps some of this or links to it could be added to the wiki?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: Multiple sender identities (composing)
  2011-05-16 16:52     ` Jameson Graef Rollins
  2011-05-16 18:03       ` Thomas Jost
  2011-05-16 22:36       ` green
@ 2011-05-17  4:38       ` Mueen Nawaz
  2 siblings, 0 replies; 35+ messages in thread
From: Mueen Nawaz @ 2011-05-17  4:38 UTC (permalink / raw)
  To: notmuch

Jameson Graef Rollins
<jrollins@finestructure.net> writes:

> This is great, guys.  I've been wanting to get something like this
> working for a while now.

Agreed. Would be awesome if someone could post it to the Wiki...

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: Multiple sender identities (composing)
  2011-05-16  9:29 Multiple sender identities (composing) Stewart Smith
  2011-05-16  9:52 ` Thomas Jost
@ 2011-05-24 21:54 ` Carl Worth
  2011-05-24 22:02   ` [PATCH] emacs: Allow user to choose "From" address when composing a new message Carl Worth
  2011-05-29 22:38   ` Multiple sender identities (composing) Stewart Smith
  2011-06-01  5:53 ` Brian May
  2 siblings, 2 replies; 35+ messages in thread
From: Carl Worth @ 2011-05-24 21:54 UTC (permalink / raw)
  To: Stewart Smith, notmuch

[-- Attachment #1: Type: text/plain, Size: 2335 bytes --]

On Mon, 16 May 2011 19:29:07 +1000, Stewart Smith <stewart@flamingspork.com> wrote:
> 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 <cworth@cworth.org>
	Carl Worth <carl.d.worth@intel.com>
	Carl Worth <carl.d.worth@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.

-Carl

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH] emacs: Allow user to choose "From" address when composing a new message.
  2011-05-24 21:54 ` Carl Worth
@ 2011-05-24 22:02   ` Carl Worth
  2011-05-25 13:21     ` Thomas Jost
  2011-05-29 22:38   ` Multiple sender identities (composing) Stewart Smith
  1 sibling, 1 reply; 35+ messages in thread
From: Carl Worth @ 2011-05-24 22:02 UTC (permalink / raw)
  To: Stewart Smith, notmuch

[-- Attachment #1: Type: text/plain, Size: 4008 bytes --]

In order to select a From address, the user simply presses M instead of
m to begin composing a message. By default the list of names/addresses
to be used during completion will be automatically generated by the
settings in the notmuch configuration file. The user can customize
the notmuch-identities variable to provide an alternate list.
---
 emacs/notmuch-hello.el |    3 ++-
 emacs/notmuch-mua.el   |   40 ++++++++++++++++++++++++++++++++++++++--
 emacs/notmuch.el       |    3 ++-
 3 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index e58dd24..5f3bcc8 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -298,7 +298,8 @@ should be. Returns a cons cell `(tags-per-line width)'."
     (define-key map "=" 'notmuch-hello-update)
     (define-key map "G" 'notmuch-hello-poll-and-update)
     (define-key map (kbd "<C-tab>") 'widget-backward)
-    (define-key map "m" 'notmuch-mua-mail)
+    (define-key map "m" 'notmuch-mua-new-mail)
+    (define-key map "M" 'notmuch-mua-new-mail-prompt-for-sender)
     (define-key map "s" 'notmuch-hello-goto-search)
     map)
   "Keymap for \"notmuch hello\" buffers.")
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index dc7b386..76bcba4 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -118,8 +118,7 @@ list."
 
 (defun notmuch-mua-mail (&optional to subject other-headers continue
 				   switch-function yank-action send-actions)
-  "Invoke the notmuch mail composition window."
-  (interactive)
+  "Invoke the notmuch mail composition window with optional headers."
 
   (when notmuch-mua-user-agent-function
     (let ((user-agent (funcall notmuch-mua-user-agent-function)))
@@ -138,6 +137,43 @@ list."
 
   (message-goto-to))
 
+(defcustom notmuch-identities nil
+  "Identities that can be used as the From: address when composing a new message.
+
+If this variable is left unset, then a list will be constructed from the
+name and addresses configured in the notmuch configuration file."
+  :group 'notmuch
+  :type '(repeat string))
+
+(defun notmuch-mua-sender-collection ()
+  (if notmuch-identities
+      notmuch-identities
+    (mapcar (lambda (address)
+	      (concat (notmuch-user-name) " <" address ">"))
+	    (cons (notmuch-user-primary-email) (notmuch-user-other-email)))))
+
+(defun notmuch-mua-new-mail-from (&optional sender)
+  (if sender
+      (notmuch-mua-mail nil nil (list (cons 'from sender)))
+    (notmuch-mua-mail)))
+
+(defvar notmuch-mua-sender-history nil)
+
+(defun notmuch-mua-new-mail (&optional prompt-for-sender)
+  "Begin composing a new email with notmuch."
+  (interactive "P")
+  (if prompt-for-sender
+      (let* ((collection (notmuch-mua-sender-collection))
+	     (sender (ido-completing-read "Send mail From: " collection
+					  nil 'confirm nil 'notmuch-mua-sender-history (car collection))))
+	(notmuch-mua-new-mail-from sender))
+    (notmuch-mua-mail)))
+
+(defun notmuch-mua-new-mail-prompt-for-sender ()
+  "Begin composing a new email with notmuch, and prompt for the From: address."
+  (interactive)
+  (notmuch-mua-new-mail t))
+
 (defun notmuch-mua-send-and-exit (&optional arg)
   (interactive "P")
   (message-send-and-exit arg))
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 64f72a0..0c1c8d0 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -204,7 +204,8 @@ For a mouse binding, return nil."
     (define-key map "p" 'notmuch-search-previous-thread)
     (define-key map "n" 'notmuch-search-next-thread)
     (define-key map "r" 'notmuch-search-reply-to-thread)
-    (define-key map "m" 'notmuch-mua-mail)
+    (define-key map "m" 'notmuch-mua-new-mail)
+    (define-key map "M" 'notmuch-mua-new-mail-prompt-for-sender)
     (define-key map "s" 'notmuch-search)
     (define-key map "o" 'notmuch-search-toggle-order)
     (define-key map "c" 'notmuch-search-stash-map)
-- 
1.7.5.1


[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [PATCH] emacs: Allow user to choose "From" address when composing a new message.
  2011-05-24 22:02   ` [PATCH] emacs: Allow user to choose "From" address when composing a new message Carl Worth
@ 2011-05-25 13:21     ` Thomas Jost
  2011-05-25 13:22       ` [PATCH 1/4] emacs: Allow the user choose the "From" address when composing a new message from notmuch-show-mode too Thomas Jost
  2011-05-25 22:17       ` [PATCH] emacs: Allow user to choose "From" address when composing a new message Carl Worth
  0 siblings, 2 replies; 35+ messages in thread
From: Thomas Jost @ 2011-05-25 13:21 UTC (permalink / raw)
  To: Carl Worth, Stewart Smith, notmuch

[-- Attachment #1: Type: text/plain, Size: 915 bytes --]

On Tue, 24 May 2011 15:02:01 -0700, Carl Worth <cworth@cworth.org> wrote:
> In order to select a From address, the user simply presses M instead of
> m to begin composing a message. By default the list of names/addresses
> to be used during completion will be automatically generated by the
> settings in the notmuch configuration file. The user can customize
> the notmuch-identities variable to provide an alternate list.

Thanks, IMHO that's better than my previous solution. And it makes my
.emacs smaller, woohoo! :)

One little issue though: you did not update notmuch-show-mode-map in
notmuch-show.el. I'll reply with a patch that fixes that (or you can
just integrate it in your commit when pushing it).

I'll also send a few additional patches that make it possible to choose
the "From" address when forwarding a message and when replying to a
message.

Regards,

-- 
Thomas/Schnouki

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 1/4] emacs: Allow the user choose the "From" address when composing a new message from notmuch-show-mode too.
  2011-05-25 13:21     ` Thomas Jost
@ 2011-05-25 13:22       ` Thomas Jost
  2011-05-25 13:22         ` [PATCH 2/4] emacs: Move the "prompt for sender" code to a new function Thomas Jost
                           ` (2 more replies)
  2011-05-25 22:17       ` [PATCH] emacs: Allow user to choose "From" address when composing a new message Carl Worth
  1 sibling, 3 replies; 35+ messages in thread
From: Thomas Jost @ 2011-05-25 13:22 UTC (permalink / raw)
  To: notmuch

---
 emacs/notmuch-show.el |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 825988c..93f46ac 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -847,7 +847,8 @@ function is used. "
 	(define-key map (kbd "<backtab>") 'notmuch-show-previous-button)
 	(define-key map (kbd "TAB") 'notmuch-show-next-button)
 	(define-key map "s" 'notmuch-search)
-	(define-key map "m" 'notmuch-mua-mail)
+	(define-key map "m" 'notmuch-mua-new-mail)
+	(define-key map "M" 'notmuch-mua-new-mail-prompt-for-sender)
 	(define-key map "f" 'notmuch-show-forward-message)
 	(define-key map "r" 'notmuch-show-reply)
 	(define-key map "|" 'notmuch-show-pipe-message)
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 2/4] emacs: Move the "prompt for sender" code to a new function.
  2011-05-25 13:22       ` [PATCH 1/4] emacs: Allow the user choose the "From" address when composing a new message from notmuch-show-mode too Thomas Jost
@ 2011-05-25 13:22         ` Thomas Jost
  2011-05-25 13:22         ` [PATCH 3/4] emacs: Allow the user to choose the "From" address when forwarding a message Thomas Jost
  2011-05-25 13:22         ` [PATCH 4/4] emacs: Allow the user to choose the "From" address when replying to " Thomas Jost
  2 siblings, 0 replies; 35+ messages in thread
From: Thomas Jost @ 2011-05-25 13:22 UTC (permalink / raw)
  To: notmuch

This allows the code to be reused in different functions without duplicating it.
---
 emacs/notmuch-mua.el |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index cd4d75d..0bde02c 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -157,21 +157,24 @@ name and addresses configured in the notmuch configuration file."
 	      (concat (notmuch-user-name) " <" address ">"))
 	    (cons (notmuch-user-primary-email) (notmuch-user-other-email)))))
 
+(defvar notmuch-mua-sender-history nil)
+
+(defun notmuch-mua-prompt-for-sender ()
+  (interactive)
+  (let ((collection (notmuch-mua-sender-collection)))
+    (ido-completing-read "Send mail From: " collection
+			 nil 'confirm nil 'notmuch-mua-sender-history (car collection))))
+
 (defun notmuch-mua-new-mail-from (&optional sender)
   (if sender
       (notmuch-mua-mail nil nil (list (cons 'from sender)))
     (notmuch-mua-mail)))
 
-(defvar notmuch-mua-sender-history nil)
-
 (defun notmuch-mua-new-mail (&optional prompt-for-sender)
   "Begin composing a new email with notmuch."
   (interactive "P")
   (if prompt-for-sender
-      (let* ((collection (notmuch-mua-sender-collection))
-	     (sender (ido-completing-read "Send mail From: " collection
-					  nil 'confirm nil 'notmuch-mua-sender-history (car collection))))
-	(notmuch-mua-new-mail-from sender))
+      (notmuch-mua-new-mail-from (notmuch-mua-prompt-for-sender))
     (notmuch-mua-mail)))
 
 (defun notmuch-mua-new-mail-prompt-for-sender ()
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 3/4] emacs: Allow the user to choose the "From" address when forwarding a message.
  2011-05-25 13:22       ` [PATCH 1/4] emacs: Allow the user choose the "From" address when composing a new message from notmuch-show-mode too Thomas Jost
  2011-05-25 13:22         ` [PATCH 2/4] emacs: Move the "prompt for sender" code to a new function Thomas Jost
@ 2011-05-25 13:22         ` Thomas Jost
  2011-05-25 13:22         ` [PATCH 4/4] emacs: Allow the user to choose the "From" address when replying to " Thomas Jost
  2 siblings, 0 replies; 35+ messages in thread
From: Thomas Jost @ 2011-05-25 13:22 UTC (permalink / raw)
  To: notmuch

---
 emacs/notmuch-mua.el  |    8 ++++++++
 emacs/notmuch-show.el |    7 +++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 0bde02c..7c08a6e 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -182,6 +182,14 @@ name and addresses configured in the notmuch configuration file."
   (interactive)
   (notmuch-mua-new-mail t))
 
+(defun notmuch-mua-forward-message-prompt-for-sender ()
+  (interactive)
+  (let* ((sender (notmuch-mua-prompt-for-sender))
+	 (address-components (mail-extract-address-components sender))
+	 (user-full-name (car address-components))
+	 (user-mail-address (cadr address-components)))
+    (notmuch-mua-forward-message)))
+
 (defun notmuch-mua-send-and-exit (&optional arg)
   (interactive "P")
   (message-send-and-exit arg))
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 93f46ac..50b20b2 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -850,6 +850,7 @@ function is used. "
 	(define-key map "m" 'notmuch-mua-new-mail)
 	(define-key map "M" 'notmuch-mua-new-mail-prompt-for-sender)
 	(define-key map "f" 'notmuch-show-forward-message)
+	(define-key map "F" 'notmuch-show-forward-message-prompt-for-sender)
 	(define-key map "r" 'notmuch-show-reply)
 	(define-key map "|" 'notmuch-show-pipe-message)
 	(define-key map "w" 'notmuch-show-save-attachments)
@@ -1165,6 +1166,12 @@ any effects from previous calls to
   (with-current-notmuch-show-message
    (notmuch-mua-forward-message)))
 
+(defun notmuch-show-forward-message-prompt-for-sender ()
+  "Forward the current message, prompting for the From: address first."
+  (interactive)
+  (with-current-notmuch-show-message
+   (notmuch-mua-forward-message-prompt-for-sender)))
+
 (defun notmuch-show-next-message ()
   "Show the next message."
   (interactive)
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 4/4] emacs: Allow the user to choose the "From" address when replying to a message.
  2011-05-25 13:22       ` [PATCH 1/4] emacs: Allow the user choose the "From" address when composing a new message from notmuch-show-mode too Thomas Jost
  2011-05-25 13:22         ` [PATCH 2/4] emacs: Move the "prompt for sender" code to a new function Thomas Jost
  2011-05-25 13:22         ` [PATCH 3/4] emacs: Allow the user to choose the "From" address when forwarding a message Thomas Jost
@ 2011-05-25 13:22         ` Thomas Jost
  2 siblings, 0 replies; 35+ messages in thread
From: Thomas Jost @ 2011-05-25 13:22 UTC (permalink / raw)
  To: notmuch

---
 emacs/notmuch-mua.el  |    9 ++++++++-
 emacs/notmuch-show.el |    6 ++++++
 emacs/notmuch.el      |    7 +++++++
 3 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 7c08a6e..d04e69c 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -69,7 +69,7 @@ list."
 	    (push header message-hidden-headers)))
 	notmuch-mua-hidden-headers))
 
-(defun notmuch-mua-reply (query-string)
+(defun notmuch-mua-reply (query-string &optional sender)
   (let (headers
 	body
 	(args '("reply")))
@@ -90,6 +90,9 @@ list."
 	      (setq headers (mail-header-extract)))))
       (forward-line 1)
       (setq body (buffer-substring (point) (point-max))))
+    ;; If sender is non-nil, set the From: header to its value.
+    (when sender
+      (mail-header-set 'from sender headers))
     (let
 	;; Overlay the composition window on that being used to read
 	;; the original message.
@@ -190,6 +193,10 @@ name and addresses configured in the notmuch configuration file."
 	 (user-mail-address (cadr address-components)))
     (notmuch-mua-forward-message)))
 
+(defun notmuch-mua-reply-prompt-for-sender (query-string)
+  (interactive)
+  (notmuch-mua-reply query-string (notmuch-mua-prompt-for-sender)))
+
 (defun notmuch-mua-send-and-exit (&optional arg)
   (interactive "P")
   (message-send-and-exit arg))
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 50b20b2..2c69e96 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -852,6 +852,7 @@ function is used. "
 	(define-key map "f" 'notmuch-show-forward-message)
 	(define-key map "F" 'notmuch-show-forward-message-prompt-for-sender)
 	(define-key map "r" 'notmuch-show-reply)
+	(define-key map "R" 'notmuch-show-reply-prompt-for-sender)
 	(define-key map "|" 'notmuch-show-pipe-message)
 	(define-key map "w" 'notmuch-show-save-attachments)
 	(define-key map "V" 'notmuch-show-view-raw-message)
@@ -1160,6 +1161,11 @@ any effects from previous calls to
   (interactive)
   (notmuch-mua-reply (notmuch-show-get-message-id)))
 
+(defun notmuch-show-reply-prompt-for-sender ()
+  "Reply to the current message, prompting for the From: address first."
+  (interactive)
+  (notmuch-mua-reply-prompt-for-sender (notmuch-show-get-message-id)))
+
 (defun notmuch-show-forward-message ()
   "Forward the current message."
   (interactive)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 1791d84..153dc74 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -204,6 +204,7 @@ For a mouse binding, return nil."
     (define-key map "p" 'notmuch-search-previous-thread)
     (define-key map "n" 'notmuch-search-next-thread)
     (define-key map "r" 'notmuch-search-reply-to-thread)
+    (define-key map "R" 'notmuch-search-reply-to-thread-prompt-for-sender)
     (define-key map "m" 'notmuch-mua-new-mail)
     (define-key map "M" 'notmuch-mua-new-mail-prompt-for-sender)
     (define-key map "s" 'notmuch-search)
@@ -449,6 +450,12 @@ Complete list of currently available key bindings:
   (let ((message-id (notmuch-search-find-thread-id)))
     (notmuch-mua-reply message-id)))
 
+(defun notmuch-search-reply-to-thread-prompt-for-sender ()
+  "Begin composing a reply to the entire current thread in a new buffer, prompting for the From: address first."
+  (interactive)
+  (let ((message-id (notmuch-search-find-thread-id)))
+    (notmuch-mua-reply-prompt-for-sender message-id)))
+
 (defun notmuch-call-notmuch-process (&rest args)
   "Synchronously invoke \"notmuch\" with the given list of arguments.
 
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [PATCH] emacs: Allow user to choose "From" address when composing a new message.
  2011-05-25 13:21     ` Thomas Jost
  2011-05-25 13:22       ` [PATCH 1/4] emacs: Allow the user choose the "From" address when composing a new message from notmuch-show-mode too Thomas Jost
@ 2011-05-25 22:17       ` Carl Worth
  2011-05-26  8:39         ` Thomas Jost
  1 sibling, 1 reply; 35+ messages in thread
From: Carl Worth @ 2011-05-25 22:17 UTC (permalink / raw)
  To: Thomas Jost, Stewart Smith, notmuch

[-- Attachment #1: Type: text/plain, Size: 1534 bytes --]

On Wed, 25 May 2011 15:21:06 +0200, Thomas Jost <schnouki@schnouki.net> wrote:
> Thanks, IMHO that's better than my previous solution. And it makes my
> .emacs smaller, woohoo! :)

Thanks for the review.

> One little issue though: you did not update notmuch-show-mode-map in
> notmuch-show.el. I'll reply with a patch that fixes that (or you can
> just integrate it in your commit when pushing it).

Good catch.

> I'll also send a few additional patches that make it possible to choose
> the "From" address when forwarding a message and when replying to a
> message.

The only real concern I have with the series is that it grabs 'R' for
reply-with-custom-from where I've been planning to implement 'R' as
reply-to-sender-only, (a long-missing and often-requested feature).

When I first started implementing the custom-from feature I planned to
use a prefix argument to get the behavior (such as "C-u m" rather than
"M" for compose-new-mail-with-custom-from). You might even see I've got
some code written along those lines.

When I went to test it though, it didn't work. That was probably some
silly mistake on my part, (we do already have working code that changes
behavior with a prefix argument in the case of "M-RET" for example).

If you want to update the series to move away from capital-letter
keybindings in favor of a prefix argument, I'll be glad to accept it.

Otherwise, I might get around to doing that myself at some point.

Thanks again,

-Carl

-- 
carl.d.worth@intel.com

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH] emacs: Allow user to choose "From" address when composing a new message.
  2011-05-25 22:17       ` [PATCH] emacs: Allow user to choose "From" address when composing a new message Carl Worth
@ 2011-05-26  8:39         ` Thomas Jost
  2011-05-26  8:41           ` [PATCH v2 1/4] emacs: Helpers needed for the user to be able to choose the " Thomas Jost
  2011-05-26 15:35           ` [PATCH] emacs: Allow user to choose "From" address when composing a new message Jameson Graef Rollins
  0 siblings, 2 replies; 35+ messages in thread
From: Thomas Jost @ 2011-05-26  8:39 UTC (permalink / raw)
  To: Carl Worth, Stewart Smith, notmuch

[-- Attachment #1: Type: text/plain, Size: 1421 bytes --]

On Wed, 25 May 2011 15:17:05 -0700, Carl Worth <cworth@cworth.org> wrote:
> > I'll also send a few additional patches that make it possible to choose
> > the "From" address when forwarding a message and when replying to a
> > message.
> 
> The only real concern I have with the series is that it grabs 'R' for
> reply-with-custom-from where I've been planning to implement 'R' as
> reply-to-sender-only, (a long-missing and often-requested feature).

That would be nice indeed :)

> When I first started implementing the custom-from feature I planned to
> use a prefix argument to get the behavior (such as "C-u m" rather than
> "M" for compose-new-mail-with-custom-from). You might even see I've got
> some code written along those lines.

Good idea, this will probably seem more natural for Emacs users.

> When I went to test it though, it didn't work. That was probably some
> silly mistake on my part, (we do already have working code that changes
> behavior with a prefix argument in the case of "M-RET" for example).
> 
> If you want to update the series to move away from capital-letter
> keybindings in favor of a prefix argument, I'll be glad to accept it.

Done and tested locally, seems OK so far. This makes the code smaller
and IMHO nicer because it eliminates all the -prompt-for-sender
variants. I'll send the updated patch series very soon.

Thanks,

-- 
Thomas/Schnouki

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH v2 1/4] emacs: Helpers needed for the user to be able to choose the "From" address when composing a new message
  2011-05-26  8:39         ` Thomas Jost
@ 2011-05-26  8:41           ` Thomas Jost
  2011-05-26  8:41             ` [PATCH v2 2/4] emacs: Allow the user " Thomas Jost
                               ` (2 more replies)
  2011-05-26 15:35           ` [PATCH] emacs: Allow user to choose "From" address when composing a new message Jameson Graef Rollins
  1 sibling, 3 replies; 35+ messages in thread
From: Thomas Jost @ 2011-05-26  8:41 UTC (permalink / raw)
  To: Carl Worth, Stewart Smith, notmuch

This adds functions and variables needed for this feature to be implemented.
Once it's done, the user will be able to use a prefix argument (e.g. pressing
C-u m instead of m) and be able to select a From address.

By default the list of names/addresses to be used during completion will be
automatically generated by the settings in the notmuch configuration file. The
user can customize the notmuch-identities variable to provide an alternate list.

This is based on a previous patch by Carl Worth
(id:"87wrhfvk6a.fsf@yoom.home.cworth.org" and follow-ups).
---
 emacs/notmuch-mua.el |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 003b313..2baf6bd 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -143,6 +143,29 @@ list."
 
   (message-goto-to))
 
+(defcustom notmuch-identities nil
+  "Identities that can be used as the From: address when composing a new message.
+
+If this variable is left unset, then a list will be constructed from the
+name and addresses configured in the notmuch configuration file."
+  :group 'notmuch
+  :type '(repeat string))
+
+(defun notmuch-mua-sender-collection ()
+  (if notmuch-identities
+      notmuch-identities
+    (mapcar (lambda (address)
+	      (concat (notmuch-user-name) " <" address ">"))
+	    (cons (notmuch-user-primary-email) (notmuch-user-other-email)))))
+
+(defvar notmuch-mua-sender-history nil)
+
+(defun notmuch-mua-prompt-for-sender ()
+  (interactive)
+  (let ((collection (notmuch-mua-sender-collection)))
+    (ido-completing-read "Send mail From: " collection
+			 nil 'confirm nil 'notmuch-mua-sender-history (car collection))))
+
 (defun notmuch-mua-send-and-exit (&optional arg)
   (interactive "P")
   (message-send-and-exit arg))
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 2/4] emacs: Allow the user to choose the "From" address when composing a new message
  2011-05-26  8:41           ` [PATCH v2 1/4] emacs: Helpers needed for the user to be able to choose the " Thomas Jost
@ 2011-05-26  8:41             ` Thomas Jost
  2011-05-26  8:41             ` [PATCH v2 3/4] emacs: Allow the user to choose the "From" address when forwarding a message Thomas Jost
  2011-05-26  8:41             ` [PATCH v2 4/4] emacs: Allow the user to choose the "From" address when replying to " Thomas Jost
  2 siblings, 0 replies; 35+ messages in thread
From: Thomas Jost @ 2011-05-26  8:41 UTC (permalink / raw)
  To: Carl Worth, Stewart Smith, notmuch

When pressing C-u m, the user will be prompted for the identity to use.
---
 emacs/notmuch-hello.el |    2 +-
 emacs/notmuch-mua.el   |   11 +++++++++++
 emacs/notmuch-show.el  |    2 +-
 emacs/notmuch.el       |    2 +-
 4 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index e58dd24..ab06d3a 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -298,7 +298,7 @@ should be. Returns a cons cell `(tags-per-line width)'."
     (define-key map "=" 'notmuch-hello-update)
     (define-key map "G" 'notmuch-hello-poll-and-update)
     (define-key map (kbd "<C-tab>") 'widget-backward)
-    (define-key map "m" 'notmuch-mua-mail)
+    (define-key map "m" 'notmuch-mua-new-mail)
     (define-key map "s" 'notmuch-hello-goto-search)
     map)
   "Keymap for \"notmuch hello\" buffers.")
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 2baf6bd..74c9fc1 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -166,6 +166,17 @@ name and addresses configured in the notmuch configuration file."
     (ido-completing-read "Send mail From: " collection
 			 nil 'confirm nil 'notmuch-mua-sender-history (car collection))))
 
+(defun notmuch-mua-new-mail (&optional prompt-for-sender)
+  "Invoke the notmuch mail composition window.
+
+If PROMPT-FOR-SENDER is non-nil, the user will be prompted for
+the From: address first."
+  (interactive "P")
+  (let ((other-headers
+	 (when prompt-for-sender
+	   (list (cons 'from (notmuch-mua-prompt-for-sender))))))
+    (notmuch-mua-mail nil nil other-headers)))
+
 (defun notmuch-mua-send-and-exit (&optional arg)
   (interactive "P")
   (message-send-and-exit arg))
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 825988c..48d2926 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -847,7 +847,7 @@ function is used. "
 	(define-key map (kbd "<backtab>") 'notmuch-show-previous-button)
 	(define-key map (kbd "TAB") 'notmuch-show-next-button)
 	(define-key map "s" 'notmuch-search)
-	(define-key map "m" 'notmuch-mua-mail)
+	(define-key map "m" 'notmuch-mua-new-mail)
 	(define-key map "f" 'notmuch-show-forward-message)
 	(define-key map "r" 'notmuch-show-reply)
 	(define-key map "|" 'notmuch-show-pipe-message)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 1d683f8..21e0314 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -204,7 +204,7 @@ For a mouse binding, return nil."
     (define-key map "p" 'notmuch-search-previous-thread)
     (define-key map "n" 'notmuch-search-next-thread)
     (define-key map "r" 'notmuch-search-reply-to-thread)
-    (define-key map "m" 'notmuch-mua-mail)
+    (define-key map "m" 'notmuch-mua-new-mail)
     (define-key map "s" 'notmuch-search)
     (define-key map "o" 'notmuch-search-toggle-order)
     (define-key map "c" 'notmuch-search-stash-map)
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 3/4] emacs: Allow the user to choose the "From" address when forwarding a message
  2011-05-26  8:41           ` [PATCH v2 1/4] emacs: Helpers needed for the user to be able to choose the " Thomas Jost
  2011-05-26  8:41             ` [PATCH v2 2/4] emacs: Allow the user " Thomas Jost
@ 2011-05-26  8:41             ` Thomas Jost
  2011-05-26  8:41             ` [PATCH v2 4/4] emacs: Allow the user to choose the "From" address when replying to " Thomas Jost
  2 siblings, 0 replies; 35+ messages in thread
From: Thomas Jost @ 2011-05-26  8:41 UTC (permalink / raw)
  To: Carl Worth, Stewart Smith, notmuch

When pressing C-u f, the user will be prompted for the identity to use.
---
 emacs/notmuch-mua.el  |   14 ++++++++++++++
 emacs/notmuch-show.el |    6 +++---
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 74c9fc1..1b777d9 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -177,6 +177,20 @@ the From: address first."
 	   (list (cons 'from (notmuch-mua-prompt-for-sender))))))
     (notmuch-mua-mail nil nil other-headers)))
 
+(defun notmuch-mua-new-forward-message (&optional prompt-for-sender)
+  "Invoke the notmuch message forwarding window.
+
+If PROMPT-FOR-SENDER is non-nil, the user will be prompted for
+the From: address first."
+  (interactive "P")
+  (if prompt-for-sender
+      (let* ((sender (notmuch-mua-prompt-for-sender))
+	     (address-components (mail-extract-address-components sender))
+	     (user-full-name (car address-components))
+	     (user-mail-address (cadr address-components)))
+	(notmuch-mua-forward-message))
+    (notmuch-mua-forward-message)))
+
 (defun notmuch-mua-send-and-exit (&optional arg)
   (interactive "P")
   (message-send-and-exit arg))
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 48d2926..7e493e9 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1158,11 +1158,11 @@ any effects from previous calls to
   (interactive)
   (notmuch-mua-reply (notmuch-show-get-message-id)))
 
-(defun notmuch-show-forward-message ()
+(defun notmuch-show-forward-message (&optional prompt-for-sender)
   "Forward the current message."
-  (interactive)
+  (interactive "P")
   (with-current-notmuch-show-message
-   (notmuch-mua-forward-message)))
+   (notmuch-mua-new-forward-message prompt-for-sender)))
 
 (defun notmuch-show-next-message ()
   "Show the next message."
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v2 4/4] emacs: Allow the user to choose the "From" address when replying to a message
  2011-05-26  8:41           ` [PATCH v2 1/4] emacs: Helpers needed for the user to be able to choose the " Thomas Jost
  2011-05-26  8:41             ` [PATCH v2 2/4] emacs: Allow the user " Thomas Jost
  2011-05-26  8:41             ` [PATCH v2 3/4] emacs: Allow the user to choose the "From" address when forwarding a message Thomas Jost
@ 2011-05-26  8:41             ` Thomas Jost
  2 siblings, 0 replies; 35+ messages in thread
From: Thomas Jost @ 2011-05-26  8:41 UTC (permalink / raw)
  To: Carl Worth, Stewart Smith, notmuch

When pressing C-u r, the user will be prompted for the identity to use.
---
 emacs/notmuch-mua.el  |   13 ++++++++++++-
 emacs/notmuch-show.el |    6 +++---
 emacs/notmuch.el      |    6 +++---
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 1b777d9..f2d86bb 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -69,7 +69,7 @@ list."
 	    (push header message-hidden-headers)))
 	notmuch-mua-hidden-headers))
 
-(defun notmuch-mua-reply (query-string)
+(defun notmuch-mua-reply (query-string &optional sender)
   (let (headers
 	body
 	(args '("reply")))
@@ -90,6 +90,9 @@ list."
 	      (setq headers (mail-header-extract)))))
       (forward-line 1)
       (setq body (buffer-substring (point) (point-max))))
+    ;; If sender is non-nil, set the From: header to its value.
+    (when sender
+      (mail-header-set 'from sender headers))
     (let
 	;; Overlay the composition window on that being used to read
 	;; the original message.
@@ -191,6 +194,14 @@ the From: address first."
 	(notmuch-mua-forward-message))
     (notmuch-mua-forward-message)))
 
+(defun notmuch-mua-new-reply (query-string &optional prompt-for-sender)
+  "Invoke the notmuch reply window."
+  (interactive "P")
+  (let ((sender
+	 (when prompt-for-sender
+	   (notmuch-mua-prompt-for-sender))))
+    (notmuch-mua-reply query-string sender)))
+
 (defun notmuch-mua-send-and-exit (&optional arg)
   (interactive "P")
   (message-send-and-exit arg))
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 7e493e9..1c5dfd7 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1153,10 +1153,10 @@ any effects from previous calls to
       ;; Move to the previous message.
       (notmuch-show-previous-message)))))
 
-(defun notmuch-show-reply ()
+(defun notmuch-show-reply (&optional prompt-for-sender)
   "Reply to the current message."
-  (interactive)
-  (notmuch-mua-reply (notmuch-show-get-message-id)))
+  (interactive "P")
+  (notmuch-mua-new-reply (notmuch-show-get-message-id) prompt-for-sender))
 
 (defun notmuch-show-forward-message (&optional prompt-for-sender)
   "Forward the current message."
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 21e0314..3d984bc 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -442,11 +442,11 @@ Complete list of currently available key bindings:
 		      crypto-switch)
       (error "End of search results"))))
 
-(defun notmuch-search-reply-to-thread ()
+(defun notmuch-search-reply-to-thread (&optional prompt-for-sender)
   "Begin composing a reply to the entire current thread in a new buffer."
-  (interactive)
+  (interactive "P")
   (let ((message-id (notmuch-search-find-thread-id)))
-    (notmuch-mua-reply message-id)))
+    (notmuch-mua-new-reply message-id prompt-for-sender)))
 
 (defun notmuch-call-notmuch-process (&rest args)
   "Synchronously invoke \"notmuch\" with the given list of arguments.
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [PATCH] emacs: Allow user to choose "From" address when composing a new message.
  2011-05-26  8:39         ` Thomas Jost
  2011-05-26  8:41           ` [PATCH v2 1/4] emacs: Helpers needed for the user to be able to choose the " Thomas Jost
@ 2011-05-26 15:35           ` Jameson Graef Rollins
  2011-05-26 17:22             ` [PATCH] emacs: Add a customization allowing to always prompt for the " Thomas Jost
  1 sibling, 1 reply; 35+ messages in thread
From: Jameson Graef Rollins @ 2011-05-26 15:35 UTC (permalink / raw)
  To: Thomas Jost, Carl Worth, Stewart Smith, notmuch

[-- Attachment #1: Type: text/plain, Size: 941 bytes --]

On Thu, 26 May 2011 10:39:58 +0200, Thomas Jost <schnouki@schnouki.net> wrote:
> > When I first started implementing the custom-from feature I planned to
> > use a prefix argument to get the behavior (such as "C-u m" rather than
> > "M" for compose-new-mail-with-custom-from). You might even see I've got
> > some code written along those lines.
> 
> Good idea, this will probably seem more natural for Emacs users.

The reason I really want to see this feature is because I always forget
to change my from address depending on the context of my email.  Given
that's my issue, I will also always forget to use a different command to
compose/reply.  In other words, I think the real way to enable this
feature should be via a customization variable.  Either that, or I'll
just modify my custom keybindings to always prompt when I just press the
regular compose/reply keys.

Thanks for work on this feature, Thomas.

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH] emacs: Add a customization allowing to always prompt for the "From" address when composing a new message
  2011-05-26 15:35           ` [PATCH] emacs: Allow user to choose "From" address when composing a new message Jameson Graef Rollins
@ 2011-05-26 17:22             ` Thomas Jost
  2011-05-26 17:46               ` Jameson Graef Rollins
  2011-05-26 21:11               ` Carl Worth
  0 siblings, 2 replies; 35+ messages in thread
From: Thomas Jost @ 2011-05-26 17:22 UTC (permalink / raw)
  To: Jameson Graef Rollins, Carl Worth, Stewart Smith, notmuch

---
Hi Jameson,

Here it is :) I'm sure it will be useful for many other people too, including
myself. To be applied on top of my other patches, then you can set
notmuch-always-prompt-for-sender to t.

Regards,
Thomas

 emacs/notmuch-mua.el |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index f2d86bb..7c05a81 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -154,6 +154,11 @@ name and addresses configured in the notmuch configuration file."
   :group 'notmuch
   :type '(repeat string))
 
+(defcustom notmuch-always-prompt-for-sender nil
+  "Always prompt for the From: address when composing a new message."
+  :group 'notmuch
+  :type 'boolean)
+
 (defun notmuch-mua-sender-collection ()
   (if notmuch-identities
       notmuch-identities
@@ -176,7 +181,7 @@ If PROMPT-FOR-SENDER is non-nil, the user will be prompted for
 the From: address first."
   (interactive "P")
   (let ((other-headers
-	 (when prompt-for-sender
+	 (when (or prompt-for-sender notmuch-always-prompt-for-sender)
 	   (list (cons 'from (notmuch-mua-prompt-for-sender))))))
     (notmuch-mua-mail nil nil other-headers)))
 
@@ -186,7 +191,7 @@ the From: address first."
 If PROMPT-FOR-SENDER is non-nil, the user will be prompted for
 the From: address first."
   (interactive "P")
-  (if prompt-for-sender
+  (if (or prompt-for-sender notmuch-always-prompt-for-sender)
       (let* ((sender (notmuch-mua-prompt-for-sender))
 	     (address-components (mail-extract-address-components sender))
 	     (user-full-name (car address-components))
@@ -198,7 +203,7 @@ the From: address first."
   "Invoke the notmuch reply window."
   (interactive "P")
   (let ((sender
-	 (when prompt-for-sender
+	 (when (or prompt-for-sender notmuch-always-prompt-for-sender)
 	   (notmuch-mua-prompt-for-sender))))
     (notmuch-mua-reply query-string sender)))
 
-- 
1.7.5.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [PATCH] emacs: Add a customization allowing to always prompt for the "From" address when composing a new message
  2011-05-26 17:22             ` [PATCH] emacs: Add a customization allowing to always prompt for the " Thomas Jost
@ 2011-05-26 17:46               ` Jameson Graef Rollins
  2011-05-26 21:11               ` Carl Worth
  1 sibling, 0 replies; 35+ messages in thread
From: Jameson Graef Rollins @ 2011-05-26 17:46 UTC (permalink / raw)
  To: Thomas Jost, Carl Worth, Stewart Smith, notmuch

[-- Attachment #1: Type: text/plain, Size: 304 bytes --]

On Thu, 26 May 2011 19:22:41 +0200, Thomas Jost <schnouki@schnouki.net> wrote:
> Here it is :) I'm sure it will be useful for many other people too, including
> myself. To be applied on top of my other patches, then you can set
> notmuch-always-prompt-for-sender to t.

Awesome!  Thanks, Thomas.

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH] emacs: Add a customization allowing to always prompt for the "From" address when composing a new message
  2011-05-26 17:22             ` [PATCH] emacs: Add a customization allowing to always prompt for the " Thomas Jost
  2011-05-26 17:46               ` Jameson Graef Rollins
@ 2011-05-26 21:11               ` Carl Worth
  2011-05-26 21:37                 ` Jameson Graef Rollins
  1 sibling, 1 reply; 35+ messages in thread
From: Carl Worth @ 2011-05-26 21:11 UTC (permalink / raw)
  To: Thomas Jost, Jameson Graef Rollins, Stewart Smith, notmuch

[-- Attachment #1: Type: text/plain, Size: 419 bytes --]

On Thu, 26 May 2011 19:22:41 +0200, Thomas Jost <schnouki@schnouki.net> wrote:
> ---
> Hi Jameson,
> 
> Here it is :) I'm sure it will be useful for many other people too, including
> myself. To be applied on top of my other patches, then you can set
> notmuch-always-prompt-for-sender to t.

Thanks, Thomas.

It's a nice patch series, and I've pushed it all out now.

-Carl

-- 
carl.d.worth@intel.com

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH] emacs: Add a customization allowing to always prompt for the "From" address when composing a new message
  2011-05-26 21:11               ` Carl Worth
@ 2011-05-26 21:37                 ` Jameson Graef Rollins
  2011-05-26 22:33                   ` Jameson Graef Rollins
  0 siblings, 1 reply; 35+ messages in thread
From: Jameson Graef Rollins @ 2011-05-26 21:37 UTC (permalink / raw)
  To: Carl Worth, Thomas Jost, Stewart Smith, notmuch

[-- Attachment #1: Type: text/plain, Size: 531 bytes --]

On Thu, 26 May 2011 14:11:11 -0700, Carl Worth <cworth@cworth.org> wrote:
> It's a nice patch series, and I've pushed it all out now.

After using this feature for a day, I think it's great.  But it would be
nice if the name was just automatically filled in, since that doesn't
change, and the ido selection cycled through just the email addresses.
I think that would make the interface a lot cleaner.  Currently I see my
name a whole bunch of times as I'm trying to search for just small
differences in the address field.

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH] emacs: Add a customization allowing to always prompt for the "From" address when composing a new message
  2011-05-26 21:37                 ` Jameson Graef Rollins
@ 2011-05-26 22:33                   ` Jameson Graef Rollins
  2011-05-27  9:14                     ` [PATCH 1/2] emacs: Don't always prompt for the "From" address when replying Thomas Jost
  0 siblings, 1 reply; 35+ messages in thread
From: Jameson Graef Rollins @ 2011-05-26 22:33 UTC (permalink / raw)
  To: Carl Worth, Thomas Jost, Stewart Smith, notmuch

[-- Attachment #1: Type: text/plain, Size: 327 bytes --]

Another thing I'm realizing is that I don't think I want the from select
to be happening when I'm replying to messages.  The reply is already
smartly picking From: address based on the To: address of the message
being replied to.  What if we just make from selector work for just
composing new messages and forwarding?

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 1/2] emacs: Don't always prompt for the "From" address when replying
  2011-05-26 22:33                   ` Jameson Graef Rollins
@ 2011-05-27  9:14                     ` Thomas Jost
  2011-05-27  9:15                       ` [PATCH 2/2] emacs: Cleaner interface when prompting for sender address Thomas Jost
  2011-05-27 10:36                       ` [PATCH 1/2] emacs: Don't always prompt for the "From" address when replying Jameson Graef Rollins
  0 siblings, 2 replies; 35+ messages in thread
From: Thomas Jost @ 2011-05-27  9:14 UTC (permalink / raw)
  To: Jameson Graef Rollins, Carl Worth, Stewart Smith, notmuch

When replying, the From: address is already filled in by notmuch reply, so most
of the time there is no need to prompt the user for it.
---
Hi Jameson,

You're right, this is mostly annoying when replying to messages. Here's a fix.

Regards,
Thomas

 emacs/notmuch-mua.el |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 7c05a81..556d2bf 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -155,7 +155,10 @@ name and addresses configured in the notmuch configuration file."
   :type '(repeat string))
 
 (defcustom notmuch-always-prompt-for-sender nil
-  "Always prompt for the From: address when composing a new message."
+  "Always prompt for the From: address when composing or forwarding a message.
+
+This is not taken into account when replying to a message, because in that case
+the From: header is already filled in by notmuch."
   :group 'notmuch
   :type 'boolean)
 
@@ -203,7 +206,7 @@ the From: address first."
   "Invoke the notmuch reply window."
   (interactive "P")
   (let ((sender
-	 (when (or prompt-for-sender notmuch-always-prompt-for-sender)
+	 (when prompt-for-sender
 	   (notmuch-mua-prompt-for-sender))))
     (notmuch-mua-reply query-string sender)))
 
-- 
1.7.5.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 2/2] emacs: Cleaner interface when prompting for sender address
  2011-05-27  9:14                     ` [PATCH 1/2] emacs: Don't always prompt for the "From" address when replying Thomas Jost
@ 2011-05-27  9:15                       ` Thomas Jost
  2011-05-27 10:37                         ` Jameson Graef Rollins
  2011-05-27 10:36                       ` [PATCH 1/2] emacs: Don't always prompt for the "From" address when replying Jameson Graef Rollins
  1 sibling, 1 reply; 35+ messages in thread
From: Thomas Jost @ 2011-05-27  9:15 UTC (permalink / raw)
  To: Jameson Graef Rollins, Carl Worth, Stewart Smith, notmuch

Most of the time, every entry in the list of identities has the same user name
part. It can then be filled in automatically, and the user can only be prompted
for the email address, which makes the interface much cleaner.
---
Hi Jameson,

Once again, a very good suggestion. I had doubts at first (because I sometimes
send mails using a nickname or on behalf of a group using that group's name),
but then I noticed I already had only one name in notmuch-identities :) So
here's a patch.

It handle 3 different cases:
- notmuch-identities is not set --> only one name
- notmuch-identities set with only one name
- notmuch-identities set with several different names

I tried to make it as compact and readable as possible, so the first two cases
are handled by a single call to ido-completing-read. But there is probably still
room for improvements: reviews, comments and suggestions are welcome.

Regards,
Thomas

 emacs/notmuch-mua.el |   33 +++++++++++++++++++++++----------
 1 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 556d2bf..274c5da 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -162,20 +162,33 @@ the From: header is already filled in by notmuch."
   :group 'notmuch
   :type 'boolean)
 
-(defun notmuch-mua-sender-collection ()
-  (if notmuch-identities
-      notmuch-identities
-    (mapcar (lambda (address)
-	      (concat (notmuch-user-name) " <" address ">"))
-	    (cons (notmuch-user-primary-email) (notmuch-user-other-email)))))
-
 (defvar notmuch-mua-sender-history nil)
 
 (defun notmuch-mua-prompt-for-sender ()
   (interactive)
-  (let ((collection (notmuch-mua-sender-collection)))
-    (ido-completing-read "Send mail From: " collection
-			 nil 'confirm nil 'notmuch-mua-sender-history (car collection))))
+  (let (name addresses one-name-only)
+    ;; If notmuch-identities is non-nil, check if there is a fixed user name.
+    (if notmuch-identities
+	(let ((components (mapcar 'mail-extract-address-components notmuch-identities)))
+	  (setq name          (caar components)
+		addresses     (mapcar 'cadr components)
+		one-name-only (eval
+			       (cons 'and
+				     (mapcar (lambda (identity)
+					       (string-equal name (car identity)))
+					     components)))))
+      ;; If notmuch-identities is nil, use values from the notmuch configuration file.
+      (setq name          (notmuch-user-name)
+	    addresses     (cons (notmuch-user-primary-email) (notmuch-user-other-email))
+	    one-name-only t))
+    ;; Now prompt the user, either for an email address only or for a full identity.
+    (if one-name-only
+	(let ((address
+	       (ido-completing-read (concat "Sender address for " name ": ") addresses
+				    nil nil nil 'notmuch-mua-sender-history (car addresses))))
+	  (concat name " <" address ">"))
+      (ido-completing-read "Send mail From: " notmuch-identities
+			   nil nil nil 'notmuch-mua-sender-history (car notmuch-identities)))))
 
 (defun notmuch-mua-new-mail (&optional prompt-for-sender)
   "Invoke the notmuch mail composition window.
-- 
1.7.5.2

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [PATCH 1/2] emacs: Don't always prompt for the "From" address when replying
  2011-05-27  9:14                     ` [PATCH 1/2] emacs: Don't always prompt for the "From" address when replying Thomas Jost
  2011-05-27  9:15                       ` [PATCH 2/2] emacs: Cleaner interface when prompting for sender address Thomas Jost
@ 2011-05-27 10:36                       ` Jameson Graef Rollins
  1 sibling, 0 replies; 35+ messages in thread
From: Jameson Graef Rollins @ 2011-05-27 10:36 UTC (permalink / raw)
  To: Thomas Jost, Carl Worth, Stewart Smith, notmuch

[-- Attachment #1: Type: text/plain, Size: 220 bytes --]

On Fri, 27 May 2011 11:14:59 +0200, Thomas Jost <schnouki@schnouki.net> wrote:
> You're right, this is mostly annoying when replying to messages. Here's a fix.

Awesome.  Thanks, Thomas.  Tested and works great.

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 2/2] emacs: Cleaner interface when prompting for sender address
  2011-05-27  9:15                       ` [PATCH 2/2] emacs: Cleaner interface when prompting for sender address Thomas Jost
@ 2011-05-27 10:37                         ` Jameson Graef Rollins
  0 siblings, 0 replies; 35+ messages in thread
From: Jameson Graef Rollins @ 2011-05-27 10:37 UTC (permalink / raw)
  To: Thomas Jost, Carl Worth, Stewart Smith, notmuch

[-- Attachment #1: Type: text/plain, Size: 416 bytes --]

On Fri, 27 May 2011 11:15:00 +0200, Thomas Jost <schnouki@schnouki.net> wrote:
> Once again, a very good suggestion. I had doubts at first (because I sometimes
> send mails using a nickname or on behalf of a group using that group's name),
> but then I noticed I already had only one name in notmuch-identities :) So
> here's a patch.

Awesome again.  This definitely makes the interface much cleaner, imho.

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: Multiple sender identities (composing)
  2011-05-24 21:54 ` Carl Worth
  2011-05-24 22:02   ` [PATCH] emacs: Allow user to choose "From" address when composing a new message Carl Worth
@ 2011-05-29 22:38   ` Stewart Smith
  1 sibling, 0 replies; 35+ messages in thread
From: Stewart Smith @ 2011-05-29 22:38 UTC (permalink / raw)
  To: Carl Worth, notmuch

On Tue, 24 May 2011 14:54:37 -0700, Carl Worth <cworth@cworth.org> wrote:
> 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 completely agree - and am rather glad that there's a proper solution now.

> 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).

I'll try trunk with the patches as soon as I get home from travel and am
somewhat remotely close to not being a zombie.

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

I hope so too... it could just be how I was trying to use it or user
ignorance or something like that.

-- 
Stewart Smith

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: Multiple sender identities (composing)
  2011-05-16  9:29 Multiple sender identities (composing) Stewart Smith
  2011-05-16  9:52 ` Thomas Jost
  2011-05-24 21:54 ` Carl Worth
@ 2011-06-01  5:53 ` Brian May
  2011-06-01  6:42   ` Thomas Jost
  2 siblings, 1 reply; 35+ messages in thread
From: Brian May @ 2011-06-01  5:53 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

On 16 May 2011 19:29, Stewart Smith <stewart@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
>

Is it possible to have it change the signature per identity also?
-- 
Brian May <brian@microcomaustralia.com.au>

[-- Attachment #2: Type: text/html, Size: 897 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: Multiple sender identities (composing)
  2011-06-01  5:53 ` Brian May
@ 2011-06-01  6:42   ` Thomas Jost
  2011-06-02  1:49     ` Brian May
  0 siblings, 1 reply; 35+ messages in thread
From: Thomas Jost @ 2011-06-01  6:42 UTC (permalink / raw)
  To: Brian May, notmuch

[-- Attachment #1: Type: text/plain, Size: 856 bytes --]

On Wed, 1 Jun 2011 15:53:18 +1000, Brian May <brian@microcomaustralia.com.au> wrote:
> On 16 May 2011 19:29, Stewart Smith <stewart@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
> >
> 
> Is it possible to have it change the signature per identity also?

There's a function that changes the signature according to the From
header in the message I sent on this list yesterday
(id:"87pqmznczk.fsf@thor.loria.fr", near the end of the message).

Regards,
-- 
Thomas/Schnouki

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: Multiple sender identities (composing)
  2011-06-01  6:42   ` Thomas Jost
@ 2011-06-02  1:49     ` Brian May
  0 siblings, 0 replies; 35+ messages in thread
From: Brian May @ 2011-06-02  1:49 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 356 bytes --]

On 1 June 2011 16:42, Thomas Jost <schnouki@schnouki.net> wrote:

> There's a function that changes the signature according to the From
> header in the message I sent on this list yesterday
> (id:"87pqmznczk.fsf@thor.loria.fr", near the end of the message).
>
>
Thanks for the pointer, it seems to work fine.
-- 
Brian May <brian@microcomaustralia.com.au>

[-- Attachment #2: Type: text/html, Size: 784 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2011-06-02  1:49 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-16  9:29 Multiple sender identities (composing) Stewart Smith
2011-05-16  9:52 ` Thomas Jost
2011-05-16 13:52   ` Stewart Smith
2011-05-16 16:52     ` Jameson Graef Rollins
2011-05-16 18:03       ` Thomas Jost
2011-05-16 18:43         ` Jameson Graef Rollins
2011-05-16 22:36       ` green
2011-05-17  4:38       ` Mueen Nawaz
2011-05-24 21:54 ` Carl Worth
2011-05-24 22:02   ` [PATCH] emacs: Allow user to choose "From" address when composing a new message Carl Worth
2011-05-25 13:21     ` Thomas Jost
2011-05-25 13:22       ` [PATCH 1/4] emacs: Allow the user choose the "From" address when composing a new message from notmuch-show-mode too Thomas Jost
2011-05-25 13:22         ` [PATCH 2/4] emacs: Move the "prompt for sender" code to a new function Thomas Jost
2011-05-25 13:22         ` [PATCH 3/4] emacs: Allow the user to choose the "From" address when forwarding a message Thomas Jost
2011-05-25 13:22         ` [PATCH 4/4] emacs: Allow the user to choose the "From" address when replying to " Thomas Jost
2011-05-25 22:17       ` [PATCH] emacs: Allow user to choose "From" address when composing a new message Carl Worth
2011-05-26  8:39         ` Thomas Jost
2011-05-26  8:41           ` [PATCH v2 1/4] emacs: Helpers needed for the user to be able to choose the " Thomas Jost
2011-05-26  8:41             ` [PATCH v2 2/4] emacs: Allow the user " Thomas Jost
2011-05-26  8:41             ` [PATCH v2 3/4] emacs: Allow the user to choose the "From" address when forwarding a message Thomas Jost
2011-05-26  8:41             ` [PATCH v2 4/4] emacs: Allow the user to choose the "From" address when replying to " Thomas Jost
2011-05-26 15:35           ` [PATCH] emacs: Allow user to choose "From" address when composing a new message Jameson Graef Rollins
2011-05-26 17:22             ` [PATCH] emacs: Add a customization allowing to always prompt for the " Thomas Jost
2011-05-26 17:46               ` Jameson Graef Rollins
2011-05-26 21:11               ` Carl Worth
2011-05-26 21:37                 ` Jameson Graef Rollins
2011-05-26 22:33                   ` Jameson Graef Rollins
2011-05-27  9:14                     ` [PATCH 1/2] emacs: Don't always prompt for the "From" address when replying Thomas Jost
2011-05-27  9:15                       ` [PATCH 2/2] emacs: Cleaner interface when prompting for sender address Thomas Jost
2011-05-27 10:37                         ` Jameson Graef Rollins
2011-05-27 10:36                       ` [PATCH 1/2] emacs: Don't always prompt for the "From" address when replying Jameson Graef Rollins
2011-05-29 22:38   ` Multiple sender identities (composing) Stewart Smith
2011-06-01  5:53 ` Brian May
2011-06-01  6:42   ` Thomas Jost
2011-06-02  1:49     ` Brian May

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).