1 Return-Path: <schnouki@schnouki.net>
\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 olra.theworths.org (Postfix) with ESMTP id B82C5429E28
\r
6 for <notmuch@notmuchmail.org>; Wed, 25 May 2011 06:23:05 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1]
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id AIHT3ClrirSe for <notmuch@notmuchmail.org>;
\r
17 Wed, 25 May 2011 06:23:04 -0700 (PDT)
\r
18 Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222])
\r
19 by olra.theworths.org (Postfix) with ESMTP id 5F911429E29
\r
20 for <notmuch@notmuchmail.org>; Wed, 25 May 2011 06:23:03 -0700 (PDT)
\r
21 Received: from localhost.localdomain (thor.loria.fr [152.81.12.250])
\r
22 by ks3536.kimsufi.com (Postfix) with ESMTPSA id BD6C36A06AF;
\r
23 Wed, 25 May 2011 15:23:02 +0200 (CEST)
\r
24 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net;
\r
25 s=key-schnouki; t=1306329782;
\r
26 bh=GvD3UjAiris4Il/Wxoiey3UHK+hu+1BsJjDYkWhJmTs=;
\r
27 h=From:To:Subject:Date:Message-Id:In-Reply-To:References;
\r
28 b=EByUc+L55dh7rDmHZ+leZsxjKTFGsGx7BbwLtHyyexWvQ/YV1/2v98ccM73bkNeEL
\r
29 7mBNDSk+2MfyKLJ/ZQxAJ7aIcGT8+1UhABQbpttJKk8fr1D2Y3dz/10EM9bilckcay
\r
30 UuHWgE6OvvH6p1v60pWQH8Mw5PT9SHDwtape/uS0=
\r
31 From: Thomas Jost <schnouki@schnouki.net>
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: [PATCH 4/4] emacs: Allow the user to choose the "From" address when
\r
34 replying to a message.
\r
35 Date: Wed, 25 May 2011 15:22:40 +0200
\r
36 Message-Id: <1306329760-16665-4-git-send-email-schnouki@schnouki.net>
\r
37 X-Mailer: git-send-email 1.7.5.1
\r
38 In-Reply-To: <1306329760-16665-1-git-send-email-schnouki@schnouki.net>
\r
39 References: <87lixu7w71.fsf@thor.loria.fr>
\r
40 <1306329760-16665-1-git-send-email-schnouki@schnouki.net>
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Wed, 25 May 2011 13:23:06 -0000
\r
56 emacs/notmuch-mua.el | 9 ++++++++-
\r
57 emacs/notmuch-show.el | 6 ++++++
\r
58 emacs/notmuch.el | 7 +++++++
\r
59 3 files changed, 21 insertions(+), 1 deletions(-)
\r
61 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
\r
62 index 7c08a6e..d04e69c 100644
\r
63 --- a/emacs/notmuch-mua.el
\r
64 +++ b/emacs/notmuch-mua.el
\r
65 @@ -69,7 +69,7 @@ list."
\r
66 (push header message-hidden-headers)))
\r
67 notmuch-mua-hidden-headers))
\r
69 -(defun notmuch-mua-reply (query-string)
\r
70 +(defun notmuch-mua-reply (query-string &optional sender)
\r
74 @@ -90,6 +90,9 @@ list."
\r
75 (setq headers (mail-header-extract)))))
\r
77 (setq body (buffer-substring (point) (point-max))))
\r
78 + ;; If sender is non-nil, set the From: header to its value.
\r
80 + (mail-header-set 'from sender headers))
\r
82 ;; Overlay the composition window on that being used to read
\r
83 ;; the original message.
\r
84 @@ -190,6 +193,10 @@ name and addresses configured in the notmuch configuration file."
\r
85 (user-mail-address (cadr address-components)))
\r
86 (notmuch-mua-forward-message)))
\r
88 +(defun notmuch-mua-reply-prompt-for-sender (query-string)
\r
90 + (notmuch-mua-reply query-string (notmuch-mua-prompt-for-sender)))
\r
92 (defun notmuch-mua-send-and-exit (&optional arg)
\r
94 (message-send-and-exit arg))
\r
95 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
96 index 50b20b2..2c69e96 100644
\r
97 --- a/emacs/notmuch-show.el
\r
98 +++ b/emacs/notmuch-show.el
\r
99 @@ -852,6 +852,7 @@ function is used. "
\r
100 (define-key map "f" 'notmuch-show-forward-message)
\r
101 (define-key map "F" 'notmuch-show-forward-message-prompt-for-sender)
\r
102 (define-key map "r" 'notmuch-show-reply)
\r
103 + (define-key map "R" 'notmuch-show-reply-prompt-for-sender)
\r
104 (define-key map "|" 'notmuch-show-pipe-message)
\r
105 (define-key map "w" 'notmuch-show-save-attachments)
\r
106 (define-key map "V" 'notmuch-show-view-raw-message)
\r
107 @@ -1160,6 +1161,11 @@ any effects from previous calls to
\r
109 (notmuch-mua-reply (notmuch-show-get-message-id)))
\r
111 +(defun notmuch-show-reply-prompt-for-sender ()
\r
112 + "Reply to the current message, prompting for the From: address first."
\r
114 + (notmuch-mua-reply-prompt-for-sender (notmuch-show-get-message-id)))
\r
116 (defun notmuch-show-forward-message ()
\r
117 "Forward the current message."
\r
119 diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
120 index 1791d84..153dc74 100644
\r
121 --- a/emacs/notmuch.el
\r
122 +++ b/emacs/notmuch.el
\r
123 @@ -204,6 +204,7 @@ For a mouse binding, return nil."
\r
124 (define-key map "p" 'notmuch-search-previous-thread)
\r
125 (define-key map "n" 'notmuch-search-next-thread)
\r
126 (define-key map "r" 'notmuch-search-reply-to-thread)
\r
127 + (define-key map "R" 'notmuch-search-reply-to-thread-prompt-for-sender)
\r
128 (define-key map "m" 'notmuch-mua-new-mail)
\r
129 (define-key map "M" 'notmuch-mua-new-mail-prompt-for-sender)
\r
130 (define-key map "s" 'notmuch-search)
\r
131 @@ -449,6 +450,12 @@ Complete list of currently available key bindings:
\r
132 (let ((message-id (notmuch-search-find-thread-id)))
\r
133 (notmuch-mua-reply message-id)))
\r
135 +(defun notmuch-search-reply-to-thread-prompt-for-sender ()
\r
136 + "Begin composing a reply to the entire current thread in a new buffer, prompting for the From: address first."
\r
138 + (let ((message-id (notmuch-search-find-thread-id)))
\r
139 + (notmuch-mua-reply-prompt-for-sender message-id)))
\r
141 (defun notmuch-call-notmuch-process (&rest args)
\r
142 "Synchronously invoke \"notmuch\" with the given list of arguments.
\r