aboutsummaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-07-01 18:45:48 -0300
committerDavid Bremner <david@tethera.net>2022-07-30 08:46:22 -0300
commit1ef7c75111b84ea19af3186ddc12f2ba434c93de (patch)
tree652e825736a3f67878ed47844be69abca8cbe750 /emacs
parent24decfc1dd294b7546da53890f1c4d16105cc8d6 (diff)
emacs/reply: reply to correct duplicate
Essentially we just need to arrange to pass the right --duplicate argument to notmuch reply. As a side-effect, correct the previously unused value of EXPECTED in T453-emacs-reply.sh.
Diffstat (limited to 'emacs')
-rw-r--r--emacs/notmuch-mua.el18
-rw-r--r--emacs/notmuch-show.el6
2 files changed, 14 insertions, 10 deletions
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 0f9ef3c2..ac878a61 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -237,11 +237,12 @@ Typically this is added to `notmuch-mua-send-hook'."
;;; Mua reply
-(defun notmuch-mua-reply (query-string &optional sender reply-all)
- (let ((args '("reply" "--format=sexp" "--format-version=5"))
- (process-crypto notmuch-show-process-crypto)
- reply
- original)
+(defun notmuch-mua-reply (query-string &optional sender reply-all duplicate)
+ (let* ((duparg (and duplicate (list (format "--duplicate=%d" duplicate))))
+ (args `("reply" "--format=sexp" "--format-version=5" ,@duparg))
+ (process-crypto notmuch-show-process-crypto)
+ reply
+ original)
(when process-crypto
(setq args (append args '("--decrypt=true"))))
(if reply-all
@@ -540,12 +541,13 @@ the From: address."
(message-hide-headers)
(set-buffer-modified-p nil))))
-(defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all)
+(defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all duplicate)
"Compose a reply to the message identified by QUERY-STRING.
If PROMPT-FOR-SENDER is non-nil, the user will be prompted for
the From: address first. If REPLY-ALL is non-nil, the message
-will be addressed to all recipients of the source message."
+will be addressed to all recipients of the source message. If
+DUPLICATE is non-nil, based the reply on that duplicate file"
;; `select-active-regions' is t by default. The reply insertion code
;; sets the region to the quoted message to make it easy to delete
;; (kill-region or C-w). These two things combine to put the quoted
@@ -560,7 +562,7 @@ will be addressed to all recipients of the source message."
(let ((sender (and prompt-for-sender
(notmuch-mua-prompt-for-sender)))
(select-active-regions nil))
- (notmuch-mua-reply query-string sender reply-all)
+ (notmuch-mua-reply query-string sender reply-all duplicate)
(deactivate-mark)))
;;; Checks
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 0d9bf071..1bc3b319 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -2020,13 +2020,15 @@ any effects from previous calls to
(defun notmuch-show-reply (&optional prompt-for-sender)
"Reply to the sender and all recipients of the current message."
(interactive "P")
- (notmuch-mua-new-reply (notmuch-show-get-message-id) prompt-for-sender t))
+ (notmuch-mua-new-reply (notmuch-show-get-message-id) prompt-for-sender t
+ (notmuch-show-get-prop :duplicate)))
(put 'notmuch-show-reply-sender 'notmuch-prefix-doc "... and prompt for sender")
(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))
+ (notmuch-mua-new-reply (notmuch-show-get-message-id) prompt-for-sender nil
+ (notmuch-show-get-prop :duplicate)))
(put 'notmuch-show-forward-message 'notmuch-prefix-doc
"... and prompt for sender")