aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs
diff options
context:
space:
mode:
authorGravatar Thomas Jost <schnouki@schnouki.net>2011-05-26 10:41:31 +0200
committerGravatar Carl Worth <cworth@cworth.org>2011-05-26 10:34:37 -0700
commit784649561abb627a9d81e4f718656dad0b6b6207 (patch)
tree1ee2e1add4b1f33dd6545f4cf865624c71b93da0 /emacs
parentfda6416745b51450b6aa41dcd0d72df843fd3292 (diff)
emacs: Allow the user to choose the "From" address when composing a new message
When pressing C-u m, the user will be prompted for the identity to use.
Diffstat (limited to 'emacs')
-rw-r--r--emacs/notmuch-hello.el2
-rw-r--r--emacs/notmuch-mua.el11
-rw-r--r--emacs/notmuch-show.el2
-rw-r--r--emacs/notmuch.el2
4 files changed, 14 insertions, 3 deletions
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index e58dd24e..ab06d3a6 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 dee2279a..c792732b 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -161,6 +161,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 9a38d9cd..93c5e53b 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -792,7 +792,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 64f72a0d..c3ed0cdb 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)