mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 10:58:10 +01:00
emacs: add support for replying just to the sender
Provide reply to sender counterparts to the search and show reply functions. Add key binding 'R' to reply to sender, while keeping 'r' as reply to all, both in search and show views. Signed-off-by: Jani Nikula <jani@nikula.org>
This commit is contained in:
parent
0f8148e920
commit
dc0919c912
3 changed files with 22 additions and 6 deletions
|
@ -71,12 +71,15 @@ list."
|
||||||
(push header message-hidden-headers)))
|
(push header message-hidden-headers)))
|
||||||
notmuch-mua-hidden-headers))
|
notmuch-mua-hidden-headers))
|
||||||
|
|
||||||
(defun notmuch-mua-reply (query-string &optional sender)
|
(defun notmuch-mua-reply (query-string &optional sender reply-all)
|
||||||
(let (headers
|
(let (headers
|
||||||
body
|
body
|
||||||
(args '("reply")))
|
(args '("reply")))
|
||||||
(if notmuch-show-process-crypto
|
(if notmuch-show-process-crypto
|
||||||
(setq args (append args '("--decrypt"))))
|
(setq args (append args '("--decrypt"))))
|
||||||
|
(if reply-all
|
||||||
|
(setq args (append args '("--reply-to=all")))
|
||||||
|
(setq args (append args '("--reply-to=sender"))))
|
||||||
(setq args (append args (list query-string)))
|
(setq args (append args (list query-string)))
|
||||||
;; This make assumptions about the output of `notmuch reply', but
|
;; This make assumptions about the output of `notmuch reply', but
|
||||||
;; really only that the headers come first followed by a blank
|
;; really only that the headers come first followed by a blank
|
||||||
|
@ -218,13 +221,13 @@ the From: address first."
|
||||||
(notmuch-mua-forward-message))
|
(notmuch-mua-forward-message))
|
||||||
(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 &optional prompt-for-sender reply-all)
|
||||||
"Invoke the notmuch reply window."
|
"Invoke the notmuch reply window."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(let ((sender
|
(let ((sender
|
||||||
(when prompt-for-sender
|
(when prompt-for-sender
|
||||||
(notmuch-mua-prompt-for-sender))))
|
(notmuch-mua-prompt-for-sender))))
|
||||||
(notmuch-mua-reply query-string sender)))
|
(notmuch-mua-reply query-string sender reply-all)))
|
||||||
|
|
||||||
(defun notmuch-mua-send-and-exit (&optional arg)
|
(defun notmuch-mua-send-and-exit (&optional arg)
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
|
|
|
@ -934,6 +934,7 @@ thread id. If a prefix is given, crypto processing is toggled."
|
||||||
(define-key map "m" 'notmuch-mua-new-mail)
|
(define-key map "m" 'notmuch-mua-new-mail)
|
||||||
(define-key map "f" 'notmuch-show-forward-message)
|
(define-key map "f" 'notmuch-show-forward-message)
|
||||||
(define-key map "r" 'notmuch-show-reply)
|
(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 "|" 'notmuch-show-pipe-message)
|
||||||
(define-key map "w" 'notmuch-show-save-attachments)
|
(define-key map "w" 'notmuch-show-save-attachments)
|
||||||
(define-key map "V" 'notmuch-show-view-raw-message)
|
(define-key map "V" 'notmuch-show-view-raw-message)
|
||||||
|
@ -1238,9 +1239,14 @@ any effects from previous calls to
|
||||||
(notmuch-show-previous-message)))))
|
(notmuch-show-previous-message)))))
|
||||||
|
|
||||||
(defun notmuch-show-reply (&optional prompt-for-sender)
|
(defun notmuch-show-reply (&optional prompt-for-sender)
|
||||||
"Reply to the current message."
|
"Reply to the sender and all recipients of the current message."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(notmuch-mua-new-reply (notmuch-show-get-message-id) prompt-for-sender))
|
(notmuch-mua-new-reply (notmuch-show-get-message-id) prompt-for-sender t))
|
||||||
|
|
||||||
|
(defun notmuch-show-reply-sender (&optional prompt-for-sender)
|
||||||
|
"Reply to the sender of the current message."
|
||||||
|
(interactive "P")
|
||||||
|
(notmuch-mua-new-reply (notmuch-show-get-message-id) prompt-for-sender nil))
|
||||||
|
|
||||||
(defun notmuch-show-forward-message (&optional prompt-for-sender)
|
(defun notmuch-show-forward-message (&optional prompt-for-sender)
|
||||||
"Forward the current message."
|
"Forward the current message."
|
||||||
|
|
|
@ -214,6 +214,7 @@ For a mouse binding, return nil."
|
||||||
(define-key map "p" 'notmuch-search-previous-thread)
|
(define-key map "p" 'notmuch-search-previous-thread)
|
||||||
(define-key map "n" 'notmuch-search-next-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)
|
||||||
|
(define-key map "R" 'notmuch-search-reply-to-thread-sender)
|
||||||
(define-key map "m" 'notmuch-mua-new-mail)
|
(define-key map "m" 'notmuch-mua-new-mail)
|
||||||
(define-key map "s" 'notmuch-search)
|
(define-key map "s" 'notmuch-search)
|
||||||
(define-key map "o" 'notmuch-search-toggle-order)
|
(define-key map "o" 'notmuch-search-toggle-order)
|
||||||
|
@ -448,10 +449,16 @@ Complete list of currently available key bindings:
|
||||||
(message "End of search results."))))
|
(message "End of search results."))))
|
||||||
|
|
||||||
(defun notmuch-search-reply-to-thread (&optional prompt-for-sender)
|
(defun notmuch-search-reply-to-thread (&optional prompt-for-sender)
|
||||||
|
"Begin composing a reply-all 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 t)))
|
||||||
|
|
||||||
|
(defun notmuch-search-reply-to-thread-sender (&optional prompt-for-sender)
|
||||||
"Begin composing a reply to the entire current thread in a new buffer."
|
"Begin composing a reply to the entire current thread in a new buffer."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(let ((message-id (notmuch-search-find-thread-id)))
|
(let ((message-id (notmuch-search-find-thread-id)))
|
||||||
(notmuch-mua-new-reply message-id prompt-for-sender)))
|
(notmuch-mua-new-reply message-id prompt-for-sender nil)))
|
||||||
|
|
||||||
(defun notmuch-call-notmuch-process (&rest args)
|
(defun notmuch-call-notmuch-process (&rest args)
|
||||||
"Synchronously invoke \"notmuch\" with the given list of arguments.
|
"Synchronously invoke \"notmuch\" with the given list of arguments.
|
||||||
|
|
Loading…
Reference in a new issue