]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: Allow the user to choose the "From" address when composing a new message
authorThomas Jost <schnouki@schnouki.net>
Thu, 26 May 2011 08:41:31 +0000 (10:41 +0200)
committerCarl Worth <cworth@cworth.org>
Thu, 26 May 2011 17:34:37 +0000 (10:34 -0700)
When pressing C-u m, the user will be prompted for the identity to use.

emacs/notmuch-hello.el
emacs/notmuch-mua.el
emacs/notmuch-show.el
emacs/notmuch.el

index e58dd24e3460ae445d9e218ca97d201e10f7ebcd..ab06d3a6a9c1937a2183f4bd10d534eed567f22a 100644 (file)
@@ -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 "=" '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.")
     (define-key map "s" 'notmuch-hello-goto-search)
     map)
   "Keymap for \"notmuch hello\" buffers.")
index dee2279a0e860c70508df66d72d23be4b3b37684..c792732ba5530b8db856cb77393c18600de0702a 100644 (file)
@@ -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))))
 
     (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))
 (defun notmuch-mua-send-and-exit (&optional arg)
   (interactive "P")
   (message-send-and-exit arg))
index 9a38d9cdbd1bde19611fd5d44557e3cfd0267ea4..93c5e53b2d235e0ead9b321011149183422216d1 100644 (file)
@@ -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 (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)
        (define-key map "f" 'notmuch-show-forward-message)
        (define-key map "r" 'notmuch-show-reply)
        (define-key map "|" 'notmuch-show-pipe-message)
index 64f72a0deec65b27f4d9e25567756e8f918c57b9..c3ed0cdb2b895a694fd5a24c2ba065122eba83d8 100644 (file)
@@ -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 "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)
     (define-key map "s" 'notmuch-search)
     (define-key map "o" 'notmuch-search-toggle-order)
     (define-key map "c" 'notmuch-search-stash-map)