Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / a3 / 59d8d99a9ab97f6e6d0609d432afd7cf19856f
1 Return-Path: <aaronecay@gmail.com>\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 9E779431FD0\r
6         for <notmuch@notmuchmail.org>; Sat, 17 Dec 2011 02:41:41 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 1.7\r
10 X-Spam-Level: *\r
11 X-Spam-Status: No, score=1.7 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, FREEMAIL_REPLY=2.499, RCVD_IN_DNSWL_LOW=-0.7]\r
14         autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id AEDEwHoIxLEx for <notmuch@notmuchmail.org>;\r
18         Sat, 17 Dec 2011 02:41:40 -0800 (PST)\r
19 Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com\r
20         [209.85.216.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id E91D3431FB6\r
23         for <notmuch@notmuchmail.org>; Sat, 17 Dec 2011 02:41:39 -0800 (PST)\r
24 Received: by qcha6 with SMTP id a6so2845555qch.26\r
25         for <notmuch@notmuchmail.org>; Sat, 17 Dec 2011 02:41:38 -0800 (PST)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
27         h=from:to:subject:date:message-id:x-mailer:in-reply-to:references;\r
28         bh=viwDbJDaWenPJpSJqC0Fwj7J+sfoH9c1+E5mboEpYfQ=;\r
29         b=vGbUXpInRrSSvnKevUZKYMCgVRc50bmPC6te4rQNtZIqmKBaXANq1aaLQWHeSteleX\r
30         LdOox60uzF7EuGRSN9UqzYAS9dCsFaoKmzcfQ3UP6KuzsqqYznVdwBqHB34upfRnijOm\r
31         Tz/LO0Z7qYmTRG3TbaEKCl9JD1iZMKSqog7BA=\r
32 Received: by 10.229.78.206 with SMTP id m14mr2877955qck.113.1324118498106;\r
33         Sat, 17 Dec 2011 02:41:38 -0800 (PST)\r
34 Received: from localhost.localdomain (c-68-80-94-73.hsd1.pa.comcast.net.\r
35         [68.80.94.73])\r
36         by mx.google.com with ESMTPS id j7sm25576002qaq.11.2011.12.17.02.41.36\r
37         (version=TLSv1/SSLv3 cipher=OTHER);\r
38         Sat, 17 Dec 2011 02:41:37 -0800 (PST)\r
39 From: Aaron Ecay <aaronecay@gmail.com>\r
40 To: notmuch@notmuchmail.org\r
41 Subject: [PATCH] [emacs] Add an argument to notmuch-mua-mail\r
42 Date: Sat, 17 Dec 2011 05:41:28 -0500\r
43 Message-Id: <1324118488-81437-1-git-send-email-aaronecay@gmail.com>\r
44 X-Mailer: git-send-email 1.7.8\r
45 In-Reply-To: <yf6wr9v4hu1.fsf@taco2.nixu.fi>\r
46 References: <yf6wr9v4hu1.fsf@taco2.nixu.fi>\r
47 X-BeenThere: notmuch@notmuchmail.org\r
48 X-Mailman-Version: 2.1.13\r
49 Precedence: list\r
50 List-Id: "Use and development of the notmuch mail system."\r
51         <notmuch.notmuchmail.org>\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
55 List-Post: <mailto:notmuch@notmuchmail.org>\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
59 X-List-Received-Date: Sat, 17 Dec 2011 10:41:41 -0000\r
60 \r
61 >From the emacs changelog:\r
62 \r
63   ** `compose-mail' now accepts an optional 8th arg, RETURN-ACTION, and\r
64   passes it to the mail user agent function.  This argument specifies an\r
65   action for returning to the caller after finishing with the mail.\r
66   This is currently used by Rmail to delete a mail window.\r
67 \r
68 Under Emacs 24, notmuch breaks when this argument is passed to it by a\r
69 function in another part of Emacs.  One example of a functon that does\r
70 this is report-emacs-bug -- so notmuch users cannot file emacs bug\r
71 reports!\r
72 \r
73 This patch also adds a &rest argument to the arg-list of this function,\r
74 to future-proof against such changes.  This is adapted from the approach\r
75 taken by message-mail, a similar function built into emacs.\r
76 \r
77 This patch was originally submitted by richardmurri@gmail.com on Aug. 1:\r
78 id:"877h6x6oor.fsf@veracitynetworks.com"\r
79 ---\r
80 \r
81 This version of the patch adopts Dmitry's arg-passing approach, and also\r
82 cleans up a long line (it is still slightly over 80 chars as I didn't\r
83 see a better way to break it).  Tomi, I don't see two interactive calls\r
84 -- I think Emacs would complain if this happened.\r
85 \r
86  emacs/notmuch-mua.el |   15 ++++++++-------\r
87  1 files changed, 8 insertions(+), 7 deletions(-)\r
88 \r
89 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
90 index 8824b08..510c951 100644\r
91 --- a/emacs/notmuch-mua.el\r
92 +++ b/emacs/notmuch-mua.el\r
93 @@ -124,9 +124,10 @@ list."\r
94  \r
95    (message-goto-to))\r
96  \r
97 -(defun notmuch-mua-mail (&optional to subject other-headers continue\r
98 -                                  switch-function yank-action send-actions)\r
99 -  "Invoke the notmuch mail composition window."\r
100 +(defun notmuch-mua-mail (&optional to subject other-headers &rest other-args)\r
101 +  "Invoke the notmuch mail composition window.\r
102 +\r
103 +OTHER-ARGS are passed through to `message-mail'."\r
104    (interactive)\r
105  \r
106    (when notmuch-mua-user-agent-function\r
107 @@ -135,11 +136,11 @@ list."\r
108         (push (cons "User-Agent" user-agent) other-headers))))\r
109  \r
110    (unless (mail-header 'from other-headers)\r
111 -    (push (cons "From" (concat\r
112 -                       (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers))\r
113 +    (push (cons "From"\r
114 +               (concat (notmuch-user-name) " <" (notmuch-user-primary-email) ">"))\r
115 +         other-headers))\r
116  \r
117 -  (message-mail to subject other-headers continue\r
118 -               switch-function yank-action send-actions)\r
119 +  (apply #'message-mail to subject other-headers other-args)\r
120    (message-sort-headers)\r
121    (message-hide-headers)\r
122    (set-buffer-modified-p nil)\r
123 -- \r
124 1.7.8\r
125 \r