Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 3C6366DE02A9 for ; Sat, 7 May 2016 12:03:27 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.268 X-Spam-Level: X-Spam-Status: No, score=0.268 tagged_above=-999 required=5 tests=[AWL=0.277, HEADER_FROM_DIFFERENT_DOMAINS=0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SxShrm-72dVw for ; Sat, 7 May 2016 12:03:18 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 3672A6DE026C for ; Sat, 7 May 2016 12:03:17 -0700 (PDT) Received: by guru.guru-group.fi (Postfix, from userid 501) id 15DD9100232; Sat, 7 May 2016 22:03:15 +0300 (EEST) From: Tomi Ollila To: notmuch@notmuchmail.org Cc: tomi.ollila@iki.fi Subject: [PATCH 1/2] emacs: add function to resend message to new recipients Date: Sat, 7 May 2016 22:03:11 +0300 Message-Id: <1462647792-25427-2-git-send-email-tomi.ollila@iki.fi> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1462647792-25427-1-git-send-email-tomi.ollila@iki.fi> References: <1462647792-25427-1-git-send-email-tomi.ollila@iki.fi> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 19:03:27 -0000 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. --- 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 aafbe5fb8328..8b79d3402184 100644 --- a/emacs/notmuch-address.el +++ b/emacs/notmuch-address.el @@ -249,6 +249,25 @@ (defun notmuch-address-harvest-trigger () ;; +(defun notmuch-address-from-minibuffer (prompt) + (if (not notmuch-address-command) + (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 (kbd "TAB") (lambda () + (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) ;;; notmuch-address.el ends here diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 5d9b7b45c557..4b8c66fdb2a1 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1855,6 +1855,14 @@ (defun notmuch-show-forward-open-messages (&optional prompt-for-sender) (error "No open messages to forward.")) (notmuch-mua-new-forward-messages open-messages prompt-for-sender))) +(defun notmuch-show-resend-message (addresses) + "Resend the current message." + (interactive (list (notmuch-address-from-minibuffer "Resend to: "))) + (when (y-or-n-p (concat "Confirm resend to " addresses " ")) + (notmuch-show-view-raw-message) + (message-resend addresses) + (notmuch-bury-or-kill-this-buffer))) + (defun notmuch-show-next-message (&optional pop-at-end) "Show the next message. -- 2.6.4