Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / f6 / eedbfee442ad0d84ecf0b0b6b8a713b948fc0a
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 76005431FD0\r
6         for <notmuch@notmuchmail.org>; Thu, 26 May 2011 01:41:56 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.1\r
10 X-Spam-Level: \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
13         autolearn=disabled\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 K0SfGm3T4oAF for <notmuch@notmuchmail.org>;\r
17         Thu, 26 May 2011 01:41:54 -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 29325429E2C\r
20         for <notmuch@notmuchmail.org>; Thu, 26 May 2011 01:41:53 -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 6B34B6A06AF;\r
23         Thu, 26 May 2011 10:41:52 +0200 (CEST)\r
24 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net;\r
25         s=key-schnouki; t=1306399312;\r
26         bh=Za9Q0Kcb+SNmSHdeZ7iBYbwo+6GcTypajYkP0eFgITw=;\r
27         h=From:To:Subject:Date:Message-Id:In-Reply-To:References;\r
28         b=FpB2aRQFr5fW1TM3PnKboR4xGPZd9odruRdqLQYx0zFTrtxVuwrRqyjeCmtOyySwD\r
29         xJ2XKHRDdjrRLm6wyofSUJM7YaRVAgCMTfz45RAhJhfwu+HuW78Ofd+peOAKMio2gu\r
30         OuoL75HJP+Fn2u84cDveQRJLUWV/LyDbmrpIx55o=\r
31 From: Thomas Jost <schnouki@schnouki.net>\r
32 To: Carl Worth <cworth@cworth.org>, Stewart Smith <stewart@flamingspork.com>,\r
33         notmuch <notmuch@notmuchmail.org>\r
34 Subject: [PATCH v2 4/4] emacs: Allow the user to choose the "From" address\r
35         when replying to a message\r
36 Date: Thu, 26 May 2011 10:41:33 +0200\r
37 Message-Id: <1306399293-22215-4-git-send-email-schnouki@schnouki.net>\r
38 X-Mailer: git-send-email 1.7.5.1\r
39 In-Reply-To: <1306399293-22215-1-git-send-email-schnouki@schnouki.net>\r
40 References: <87hb8hlush.fsf@thor.loria.fr>\r
41         <1306399293-22215-1-git-send-email-schnouki@schnouki.net>\r
42 X-BeenThere: notmuch@notmuchmail.org\r
43 X-Mailman-Version: 2.1.13\r
44 Precedence: list\r
45 List-Id: "Use and development of the notmuch mail system."\r
46         <notmuch.notmuchmail.org>\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
50 List-Post: <mailto:notmuch@notmuchmail.org>\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
54 X-List-Received-Date: Thu, 26 May 2011 08:41:56 -0000\r
55 \r
56 When pressing C-u r, the user will be prompted for the identity to use.\r
57 ---\r
58  emacs/notmuch-mua.el  |   13 ++++++++++++-\r
59  emacs/notmuch-show.el |    6 +++---\r
60  emacs/notmuch.el      |    6 +++---\r
61  3 files changed, 18 insertions(+), 7 deletions(-)\r
62 \r
63 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
64 index 1b777d9..f2d86bb 100644\r
65 --- a/emacs/notmuch-mua.el\r
66 +++ b/emacs/notmuch-mua.el\r
67 @@ -69,7 +69,7 @@ list."\r
68             (push header message-hidden-headers)))\r
69         notmuch-mua-hidden-headers))\r
70  \r
71 -(defun notmuch-mua-reply (query-string)\r
72 +(defun notmuch-mua-reply (query-string &optional sender)\r
73    (let (headers\r
74         body\r
75         (args '("reply")))\r
76 @@ -90,6 +90,9 @@ list."\r
77               (setq headers (mail-header-extract)))))\r
78        (forward-line 1)\r
79        (setq body (buffer-substring (point) (point-max))))\r
80 +    ;; If sender is non-nil, set the From: header to its value.\r
81 +    (when sender\r
82 +      (mail-header-set 'from sender headers))\r
83      (let\r
84         ;; Overlay the composition window on that being used to read\r
85         ;; the original message.\r
86 @@ -191,6 +194,14 @@ the From: address first."\r
87         (notmuch-mua-forward-message))\r
88      (notmuch-mua-forward-message)))\r
89  \r
90 +(defun notmuch-mua-new-reply (query-string &optional prompt-for-sender)\r
91 +  "Invoke the notmuch reply window."\r
92 +  (interactive "P")\r
93 +  (let ((sender\r
94 +        (when prompt-for-sender\r
95 +          (notmuch-mua-prompt-for-sender))))\r
96 +    (notmuch-mua-reply query-string sender)))\r
97 +\r
98  (defun notmuch-mua-send-and-exit (&optional arg)\r
99    (interactive "P")\r
100    (message-send-and-exit arg))\r
101 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
102 index 7e493e9..1c5dfd7 100644\r
103 --- a/emacs/notmuch-show.el\r
104 +++ b/emacs/notmuch-show.el\r
105 @@ -1153,10 +1153,10 @@ any effects from previous calls to\r
106        ;; Move to the previous message.\r
107        (notmuch-show-previous-message)))))\r
108  \r
109 -(defun notmuch-show-reply ()\r
110 +(defun notmuch-show-reply (&optional prompt-for-sender)\r
111    "Reply to the current message."\r
112 -  (interactive)\r
113 -  (notmuch-mua-reply (notmuch-show-get-message-id)))\r
114 +  (interactive "P")\r
115 +  (notmuch-mua-new-reply (notmuch-show-get-message-id) prompt-for-sender))\r
116  \r
117  (defun notmuch-show-forward-message (&optional prompt-for-sender)\r
118    "Forward the current message."\r
119 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
120 index 21e0314..3d984bc 100644\r
121 --- a/emacs/notmuch.el\r
122 +++ b/emacs/notmuch.el\r
123 @@ -442,11 +442,11 @@ Complete list of currently available key bindings:\r
124                       crypto-switch)\r
125        (error "End of search results"))))\r
126  \r
127 -(defun notmuch-search-reply-to-thread ()\r
128 +(defun notmuch-search-reply-to-thread (&optional prompt-for-sender)\r
129    "Begin composing a reply to the entire current thread in a new buffer."\r
130 -  (interactive)\r
131 +  (interactive "P")\r
132    (let ((message-id (notmuch-search-find-thread-id)))\r
133 -    (notmuch-mua-reply message-id)))\r
134 +    (notmuch-mua-new-reply message-id prompt-for-sender)))\r
135  \r
136  (defun notmuch-call-notmuch-process (&rest args)\r
137    "Synchronously invoke \"notmuch\" with the given list of arguments.\r
138 -- \r
139 1.7.5.1\r
140 \r