[PATCH 3/4] Emacs changes for reply-to-sender
Mark Walters
markwalters1009 at gmail.com
Fri Jan 6 05:34:16 PST 2012
Reply to sender is currently bound to R
---
emacs/notmuch-mua.el | 8 +++++---
emacs/notmuch-show.el | 8 +++++++-
emacs/notmuch.el | 2 +-
3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 7114e48..7171210 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -71,12 +71,14 @@ list."
(push header message-hidden-headers)))
notmuch-mua-hidden-headers))
-(defun notmuch-mua-reply (query-string &optional sender)
+(defun notmuch-mua-reply (query-string option-string &optional sender)
(let (headers
body
(args '("reply")))
(if notmuch-show-process-crypto
(setq args (append args '("--decrypt"))))
+ (if option-string
+ (setq args (append args (list option-string))))
(setq args (append args (list query-string)))
;; This make assumptions about the output of `notmuch reply', but
;; really only that the headers come first followed by a blank
@@ -217,13 +219,13 @@ the From: address first."
(notmuch-mua-forward-message))
(notmuch-mua-forward-message)))
-(defun notmuch-mua-new-reply (query-string &optional prompt-for-sender)
+(defun notmuch-mua-new-reply (query-string option-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)))
+ (notmuch-mua-reply query-string option-string sender)))
(defun notmuch-mua-send-and-exit (&optional arg)
(interactive "P")
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 5502efd..40bea0c 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -933,6 +933,7 @@ thread id. If a prefix is given, crypto processing is toggled."
(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 "R" 'notmuch-show-reply-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)
@@ -1239,7 +1240,12 @@ any effects from previous calls to
(defun notmuch-show-reply (&optional prompt-for-sender)
"Reply to the current message."
(interactive "P")
- (notmuch-mua-new-reply (notmuch-show-get-message-id) prompt-for-sender))
+ (notmuch-mua-new-reply (notmuch-show-get-message-id) nil prompt-for-sender))
+
+(defun notmuch-show-reply-sender (&optional prompt-for-sender)
+ "Reply to the current message but only to sender."
+ (interactive "P")
+ (notmuch-mua-new-reply (notmuch-show-get-message-id) "--reply-to=sender" 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 fde2377..022b867 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -444,7 +444,7 @@ Complete list of currently available key bindings:
"Begin composing a reply to the entire current thread in a new buffer."
(interactive "P")
(let ((message-id (notmuch-search-find-thread-id)))
- (notmuch-mua-new-reply message-id prompt-for-sender)))
+ (notmuch-mua-new-reply message-id nil prompt-for-sender)))
(defun notmuch-call-notmuch-process (&rest args)
"Synchronously invoke \"notmuch\" with the given list of arguments.
--
1.7.2.3
More information about the notmuch
mailing list