From b798e94cccb4918195f294ca301bf08a7a18c4b8 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Wed, 2 Sep 2015 17:34:41 +0300 Subject: [PATCH] [PATCH 3/4] emacs: add function to resend message to new recipients --- f0/b490ab136083b68861560eb097a5b753670232 | 112 ++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 f0/b490ab136083b68861560eb097a5b753670232 diff --git a/f0/b490ab136083b68861560eb097a5b753670232 b/f0/b490ab136083b68861560eb097a5b753670232 new file mode 100644 index 000000000..f1da783bd --- /dev/null +++ b/f0/b490ab136083b68861560eb097a5b753670232 @@ -0,0 +1,112 @@ +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 15D266DE0B38 + for ; Wed, 2 Sep 2015 07:36:20 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.232 +X-Spam-Level: +X-Spam-Status: No, score=0.232 tagged_above=-999 required=5 tests=[AWL=0.772, + RP_MATCHES_RCVD=-0.55, T_HEADER_FROM_DIFFERENT_DOMAINS=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 tfFZ3ZQxj0SL for ; + Wed, 2 Sep 2015 07:36:17 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by arlo.cworth.org (Postfix) with ESMTP id 1DC916DE0C3A + for ; Wed, 2 Sep 2015 07:36:16 -0700 (PDT) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id 4511D10034D; Wed, 2 Sep 2015 17:34:47 +0300 (EEST) +From: Tomi Ollila +To: notmuch@notmuchmail.org +Subject: [PATCH 3/4] emacs: add function to resend message to new recipients +Date: Wed, 2 Sep 2015 17:34:41 +0300 +Message-Id: <1441204482-26509-3-git-send-email-tomi.ollila@iki.fi> +X-Mailer: git-send-email 2.0.0 +In-Reply-To: <1441204482-26509-1-git-send-email-tomi.ollila@iki.fi> +References: <1441204482-26509-1-git-send-email-tomi.ollila@iki.fi> +Cc: tomi.ollila@iki.fi +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.18 +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: Wed, 02 Sep 2015 14:36:20 -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. +--- + +Since id:1440619626-18768-2-git-send-email-tomi.ollila@iki.fi + - changed (bury-buffer) to (notmuch-bury-or-kill-this-buffer) + - it is hard to have the buffer been kept around but it is posiible + + 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 8982a415ce11..83788efd3c1b 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 0565ab0725b2..046cb0e41f0b 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) ++ (notmuch-bury-or-kill-this-buffer))) ++ + (defun notmuch-show-next-message (&optional pop-at-end) + "Show the next message. + +-- +2.0.0 + -- 2.26.2