--- /dev/null
+Return-Path: <too@guru-group.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 3C6366DE02A9\r
+ for <notmuch@notmuchmail.org>; Sat, 7 May 2016 12:03:27 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.268\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.268 tagged_above=-999 required=5 tests=[AWL=0.277, \r
+ HEADER_FROM_DIFFERENT_DOMAINS=0.001, T_RP_MATCHES_RCVD=-0.01]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id SxShrm-72dVw for <notmuch@notmuchmail.org>;\r
+ Sat, 7 May 2016 12:03:18 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 3672A6DE026C\r
+ for <notmuch@notmuchmail.org>; Sat, 7 May 2016 12:03:17 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+ id 15DD9100232; Sat, 7 May 2016 22:03:15 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Cc: tomi.ollila@iki.fi\r
+Subject: [PATCH 1/2] emacs: add function to resend message to new recipients\r
+Date: Sat, 7 May 2016 22:03:11 +0300\r
+Message-Id: <1462647792-25427-2-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 2.6.4\r
+In-Reply-To: <1462647792-25427-1-git-send-email-tomi.ollila@iki.fi>\r
+References: <1462647792-25427-1-git-send-email-tomi.ollila@iki.fi>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 07 May 2016 19:03:27 -0000\r
+\r
+The new function notmuch-show-message-resend re-sends\r
+message to new recipients using #'message-resend.\r
+\r
+Recipients are read from minibuffer as a comma-separated\r
+string (with some keyboard support including tab completion).\r
+\r
+Final confirmation before sending is asked.\r
+---\r
+ emacs/notmuch-address.el | 19 +++++++++++++++++++\r
+ emacs/notmuch-show.el | 8 ++++++++\r
+ 2 files changed, 27 insertions(+)\r
+\r
+diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el\r
+index aafbe5fb8328..8b79d3402184 100644\r
+--- a/emacs/notmuch-address.el\r
++++ b/emacs/notmuch-address.el\r
+@@ -249,6 +249,25 @@ (defun notmuch-address-harvest-trigger ()\r
+ \r
+ ;;\r
+ \r
++(defun notmuch-address-from-minibuffer (prompt)\r
++ (if (not notmuch-address-command)\r
++ (read-string prompt)\r
++ (let ((rmap (copy-keymap minibuffer-local-map))\r
++ (omap minibuffer-local-map))\r
++ ;; Configure TAB to start completion when executing read-string.\r
++ ;; "Original" minibuffer keymap is restored just before calling\r
++ ;; notmuch-address-expand-name as it may also use minibuffer-local-map\r
++ ;; (completing-read probably does not but if something else is used there).\r
++ (define-key rmap (kbd "TAB") (lambda ()\r
++ (interactive)\r
++ (let ((enable-recursive-minibuffers t)\r
++ (minibuffer-local-map omap))\r
++ (notmuch-address-expand-name))))\r
++ (let ((minibuffer-local-map rmap))\r
++ (read-string prompt)))))\r
++\r
++;;\r
++\r
+ (provide 'notmuch-address)\r
+ \r
+ ;;; notmuch-address.el ends here\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 5d9b7b45c557..4b8c66fdb2a1 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -1855,6 +1855,14 @@ (defun notmuch-show-forward-open-messages (&optional prompt-for-sender)\r
+ (error "No open messages to forward."))\r
+ (notmuch-mua-new-forward-messages open-messages prompt-for-sender)))\r
+ \r
++(defun notmuch-show-resend-message (addresses)\r
++ "Resend the current message."\r
++ (interactive (list (notmuch-address-from-minibuffer "Resend to: ")))\r
++ (when (y-or-n-p (concat "Confirm resend to " addresses " "))\r
++ (notmuch-show-view-raw-message)\r
++ (message-resend addresses)\r
++ (notmuch-bury-or-kill-this-buffer)))\r
++\r
+ (defun notmuch-show-next-message (&optional pop-at-end)\r
+ "Show the next message.\r
+ \r
+-- \r
+2.6.4\r
+\r