1 Return-Path: <too@guru-group.fi>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by arlo.cworth.org (Postfix) with ESMTP id 78D616DE02C9
\r
6 for <notmuch@notmuchmail.org>; Wed, 26 Aug 2015 13:08:41 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=0.255 tagged_above=-999 required=5 tests=[AWL=0.795,
\r
12 RP_MATCHES_RCVD=-0.55, T_HEADER_FROM_DIFFERENT_DOMAINS=0.01]
\r
14 Received: from arlo.cworth.org ([127.0.0.1])
\r
15 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id Xp2ywlV0asBl for <notmuch@notmuchmail.org>;
\r
17 Wed, 26 Aug 2015 13:08:39 -0700 (PDT)
\r
18 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
19 by arlo.cworth.org (Postfix) with ESMTP id A3F686DE0275
\r
20 for <notmuch@notmuchmail.org>; Wed, 26 Aug 2015 13:08:39 -0700 (PDT)
\r
21 Received: by guru.guru-group.fi (Postfix, from userid 501)
\r
22 id E6AD710023D; Wed, 26 Aug 2015 23:07:08 +0300 (EEST)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: notmuch@notmuchmail.org
\r
25 Subject: [PATCH 2/2] emacs: add function to resend message to new recipients
\r
26 Date: Wed, 26 Aug 2015 23:07:06 +0300
\r
27 Message-Id: <1440619626-18768-2-git-send-email-tomi.ollila@iki.fi>
\r
28 X-Mailer: git-send-email 2.0.0
\r
29 In-Reply-To: <1440619626-18768-1-git-send-email-tomi.ollila@iki.fi>
\r
30 References: <1440619626-18768-1-git-send-email-tomi.ollila@iki.fi>
\r
31 Cc: tomi.ollila@iki.fi
\r
32 X-BeenThere: notmuch@notmuchmail.org
\r
33 X-Mailman-Version: 2.1.18
\r
35 List-Id: "Use and development of the notmuch mail system."
\r
36 <notmuch.notmuchmail.org>
\r
37 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
38 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
39 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
40 List-Post: <mailto:notmuch@notmuchmail.org>
\r
41 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
42 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
43 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
44 X-List-Received-Date: Wed, 26 Aug 2015 20:08:41 -0000
\r
46 The new function notmuch-show-message-resend re-sends
\r
47 message to new recipients using #'message-resend.
\r
49 Recipients are read from minibuffer as a comma-separated
\r
50 string (with some keyboard support including tab completion).
\r
52 Final confirmation before sending is asked.
\r
55 Note that notmuch-show-message-resend is not (yet) bound to any
\r
56 keybindings in notmuch-show-mode-map (nor notmuch-tree-mode-map!).
\r
58 I remember that Emacs VM might have had 'b' bound to this functionality
\r
59 but I cannot be sure. A few weeks ago I looked gnus, rmail & mh-e to
\r
60 figure out whether 'b' would have been bound to similar functionality
\r
61 there but I cannot find it...
\r
63 A future patch will be done when we've decide where to bind this.
\r
65 Also, I "simplified" keybindings in notmuch-address-from-minibuffer --
\r
66 latest version used to bind ',' in both minibuffer-local-map and
\r
67 minibuffer-local-completion-map to do some magic. I'll send an RFC
\r
68 patch having that later.
\r
70 emacs/notmuch-address.el | 19 +++++++++++++++++++
\r
71 emacs/notmuch-show.el | 8 ++++++++
\r
72 2 files changed, 27 insertions(+)
\r
74 diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
\r
75 index 6c93b2a7a820..b08a78f2db46 100644
\r
76 --- a/emacs/notmuch-address.el
\r
77 +++ b/emacs/notmuch-address.el
\r
78 @@ -119,4 +119,23 @@ (defun notmuch-address-locate-command (command)
\r
82 +(defun notmuch-address-from-minibuffer (prompt)
\r
83 + (if (not (notmuch-address--message-insinuated))
\r
84 + (read-string prompt)
\r
85 + (let ((rmap (copy-keymap minibuffer-local-map))
\r
86 + (omap minibuffer-local-map))
\r
87 + ;; Configure TAB to start completion when executing read-string.
\r
88 + ;; "Original" minibuffer keymap is restored just before calling
\r
89 + ;; notmuch-address-expand-name as it may also use minibuffer-local-map
\r
90 + ;; (completing-read probably does not but if something else is used there).
\r
91 + (define-key rmap "\C-i" (lambda () ;; TAB
\r
93 + (let ((enable-recursive-minibuffers t)
\r
94 + (minibuffer-local-map omap))
\r
95 + (notmuch-address-expand-name))))
\r
96 + (let ((minibuffer-local-map rmap))
\r
97 + (read-string prompt)))))
\r
101 (provide 'notmuch-address)
\r
102 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
103 index 848ec2c870c4..62aa696224ca 100644
\r
104 --- a/emacs/notmuch-show.el
\r
105 +++ b/emacs/notmuch-show.el
\r
106 @@ -1806,6 +1806,14 @@ (defun notmuch-show-forward-message (&optional prompt-for-sender)
\r
107 (with-current-notmuch-show-message
\r
108 (notmuch-mua-new-forward-message prompt-for-sender)))
\r
110 +(defun notmuch-show-resend-message (addresses)
\r
111 + "Resend the current message."
\r
112 + (interactive (list (notmuch-address-from-minibuffer "Resend to: ")))
\r
113 + (when (yes-or-no-p (concat "Confirm resend to " addresses " "))
\r
114 + (notmuch-show-view-raw-message)
\r
115 + (message-resend addresses)
\r
118 (defun notmuch-show-next-message (&optional pop-at-end)
\r
119 "Show the next message.
\r