From f7cc259c10cc1a1c85b48d6c826c5e9effb3e34a Mon Sep 17 00:00:00 2001 From: Thomas Jost Date: Thu, 26 May 2011 10:41:33 +0200 Subject: emacs: Allow the user to choose the "From" address when replying to a message When pressing C-u r, the user will be prompted for the identity to use. --- emacs/notmuch-mua.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'emacs/notmuch-mua.el') diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 7b0aa315..6575af64 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) ;; This make assumptions about the output of `notmuch reply', but ;; really only that the headers come first followed by a blank @@ -85,6 +85,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. @@ -186,6 +189,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)) -- cgit v1.2.3