[PATCH 2/2] emacs: add function to resend message to new recipients
Tomi Ollila
tomi.ollila at iki.fi
Wed Aug 26 13:07:06 PDT 2015
The new function notmuch-show-message-resend re-sends
message to new recipients using #'message-resend.
Recipients are read from minibuffer as a comma-separated
string (with some keyboard support including tab completion).
Final confirmation before sending is asked.
---
Note that notmuch-show-message-resend is not (yet) bound to any
keybindings in notmuch-show-mode-map (nor notmuch-tree-mode-map!).
I remember that Emacs VM might have had 'b' bound to this functionality
but I cannot be sure. A few weeks ago I looked gnus, rmail & mh-e to
figure out whether 'b' would have been bound to similar functionality
there but I cannot find it...
A future patch will be done when we've decide where to bind this.
Also, I "simplified" keybindings in notmuch-address-from-minibuffer --
latest version used to bind ',' in both minibuffer-local-map and
minibuffer-local-completion-map to do some magic. I'll send an RFC
patch having that later.
emacs/notmuch-address.el | 19 +++++++++++++++++++
emacs/notmuch-show.el | 8 ++++++++
2 files changed, 27 insertions(+)
diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 6c93b2a7a820..b08a78f2db46 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -119,4 +119,23 @@ (defun notmuch-address-locate-command (command)
;;
+(defun notmuch-address-from-minibuffer (prompt)
+ (if (not (notmuch-address--message-insinuated))
+ (read-string prompt)
+ (let ((rmap (copy-keymap minibuffer-local-map))
+ (omap minibuffer-local-map))
+ ;; Configure TAB to start completion when executing read-string.
+ ;; "Original" minibuffer keymap is restored just before calling
+ ;; notmuch-address-expand-name as it may also use minibuffer-local-map
+ ;; (completing-read probably does not but if something else is used there).
+ (define-key rmap "\C-i" (lambda () ;; TAB
+ (interactive)
+ (let ((enable-recursive-minibuffers t)
+ (minibuffer-local-map omap))
+ (notmuch-address-expand-name))))
+ (let ((minibuffer-local-map rmap))
+ (read-string prompt)))))
+
+;;
+
(provide 'notmuch-address)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 848ec2c870c4..62aa696224ca 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1806,6 +1806,14 @@ (defun notmuch-show-forward-message (&optional prompt-for-sender)
(with-current-notmuch-show-message
(notmuch-mua-new-forward-message prompt-for-sender)))
+(defun notmuch-show-resend-message (addresses)
+ "Resend the current message."
+ (interactive (list (notmuch-address-from-minibuffer "Resend to: ")))
+ (when (yes-or-no-p (concat "Confirm resend to " addresses " "))
+ (notmuch-show-view-raw-message)
+ (message-resend addresses)
+ (bury-buffer)))
+
(defun notmuch-show-next-message (&optional pop-at-end)
"Show the next message.
--
2.0.0
More information about the notmuch
mailing list