Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / 13 / 3a14b751d89a4659b6e708ebaa2980b3fc7bed
1 Return-Path: <markwalters1009@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 EA5A7429E5C\r
6         for <notmuch@notmuchmail.org>; Thu, 22 Aug 2013 10:11:38 -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.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] 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 xc0Wk2tpHQz8 for <notmuch@notmuchmail.org>;\r
18         Thu, 22 Aug 2013 10:11:33 -0700 (PDT)\r
19 Received: from mail-we0-f176.google.com (mail-we0-f176.google.com\r
20         [74.125.82.176]) (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 37A47429E4D\r
23         for <notmuch@notmuchmail.org>; Thu, 22 Aug 2013 10:10:59 -0700 (PDT)\r
24 Received: by mail-we0-f176.google.com with SMTP id q56so1927653wes.21\r
25         for <notmuch@notmuchmail.org>; Thu, 22 Aug 2013 10:10:58 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
28         bh=Vw+jIYny2aEJe8NNd7HlLHtABC6svW3HFSPkWhrf10o=;\r
29         b=yJ225FHx/11InPcOj4VEGMn66kg6EunVJwNOxehwjIR+DFKazWwF3SlDF1KcIHk6aD\r
30         h4dCr0Qkc2DYqXYUkNDKGI1gVw2aeqv3+eGJ7lEVIvT+UgZmpa6RDAWASj49RYA1TERv\r
31         P/vO+pdT7beVQ7lgxA5X2TJqbz2IZCSEAxFw+ve+ROMzp5gNC/wwnisz7U4/YUdAuDRr\r
32         EIa030rPJ9JxOCaricbsFitBQHuoDpwX/UBGYiVotpGpbwspK2EI7gLHcfkV9b15uVuN\r
33         kTiuadDIbUoMi5ayii9+q9HPoXdsgZN+DdnW+4HrlpF43C5L9bA+/XcaJ4qVIDDnyzJh\r
34         7jlQ==\r
35 X-Received: by 10.180.185.166 with SMTP id fd6mr21977636wic.5.1377191458084;\r
36         Thu, 22 Aug 2013 10:10:58 -0700 (PDT)\r
37 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
38         by mx.google.com with ESMTPSA id a8sm39517330wie.6.1969.12.31.16.00.00\r
39         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
40         Thu, 22 Aug 2013 10:10:57 -0700 (PDT)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH v3 11/11] contrib: pick: use close-message-pane for reply etc\r
44 Date: Thu, 22 Aug 2013 18:10:26 +0100\r
45 Message-Id: <1377191427-6821-12-git-send-email-markwalters1009@gmail.com>\r
46 X-Mailer: git-send-email 1.7.9.1\r
47 In-Reply-To: <1377191427-6821-1-git-send-email-markwalters1009@gmail.com>\r
48 References: <1377191427-6821-1-git-send-email-markwalters1009@gmail.com>\r
49 X-BeenThere: notmuch@notmuchmail.org\r
50 X-Mailman-Version: 2.1.13\r
51 Precedence: list\r
52 List-Id: "Use and development of the notmuch mail system."\r
53         <notmuch.notmuchmail.org>\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
57 List-Post: <mailto:notmuch@notmuchmail.org>\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
61 X-List-Received-Date: Thu, 22 Aug 2013 17:11:39 -0000\r
62 \r
63 We can save some code duplication by using the new close-message-pane\r
64 functionality for reply, forward, and new mail.\r
65 ---\r
66  contrib/notmuch-pick/notmuch-pick.el |   43 +++------------------------------\r
67  1 files changed, 4 insertions(+), 39 deletions(-)\r
68 \r
69 diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el\r
70 index 6e71fef..37dc161 100644\r
71 --- a/contrib/notmuch-pick/notmuch-pick.el\r
72 +++ b/contrib/notmuch-pick/notmuch-pick.el\r
73 @@ -236,6 +236,10 @@ FUNC."\r
74      (define-key map "e" (notmuch-pick-to-message-pane #'notmuch-pick-button-activate))\r
75  \r
76      ;; bindings from show (or elsewhere) but we close the message pane first.\r
77 +    (define-key map "m" (notmuch-pick-close-message-pane-and #'notmuch-mua-new-mail))\r
78 +    (define-key map "f" (notmuch-pick-close-message-pane-and #'notmuch-show-forward-message))\r
79 +    (define-key map "r" (notmuch-pick-close-message-pane-and #'notmuch-show-reply-sender))\r
80 +    (define-key map "R" (notmuch-pick-close-message-pane-and #'notmuch-show-reply))\r
81      (define-key map "V" (notmuch-pick-close-message-pane-and #'notmuch-show-view-raw-message))\r
82      (define-key map "?" (notmuch-pick-close-message-pane-and #'notmuch-help))\r
83  \r
84 @@ -246,10 +250,6 @@ FUNC."\r
85      (define-key map "=" 'notmuch-pick-refresh-view)\r
86      (define-key map "s" 'notmuch-pick-to-search)\r
87      (define-key map "z" 'notmuch-pick-to-pick)\r
88 -    (define-key map "m" 'notmuch-pick-new-mail)\r
89 -    (define-key map "f" 'notmuch-pick-forward-message)\r
90 -    (define-key map "r" 'notmuch-pick-reply-sender)\r
91 -    (define-key map "R" 'notmuch-pick-reply)\r
92      (define-key map "n" 'notmuch-pick-next-matching-message)\r
93      (define-key map "p" 'notmuch-pick-prev-matching-message)\r
94      (define-key map "N" 'notmuch-pick-next-message)\r
95 @@ -599,41 +599,6 @@ message will be \"unarchived\", i.e. the tag changes in\r
96                          target\r
97                          (get-buffer buffer-name))))\r
98  \r
99 -(defmacro with-current-notmuch-pick-message (&rest body)\r
100 -  "Evaluate body with current buffer set to the text of current message"\r
101 -  `(save-excursion\r
102 -     (let ((id (notmuch-pick-get-message-id)))\r
103 -       (let ((buf (generate-new-buffer (concat "*notmuch-msg-" id "*"))))\r
104 -         (with-current-buffer buf\r
105 -           (call-process notmuch-command nil t nil "show" "--format=raw" id)\r
106 -           ,@body)\r
107 -        (kill-buffer buf)))))\r
108 -\r
109 -(defun notmuch-pick-new-mail (&optional prompt-for-sender)\r
110 -  "Compose new mail."\r
111 -  (interactive "P")\r
112 -  (notmuch-pick-close-message-window)\r
113 -  (notmuch-mua-new-mail prompt-for-sender ))\r
114 -\r
115 -(defun notmuch-pick-forward-message (&optional prompt-for-sender)\r
116 -  "Forward the current message."\r
117 -  (interactive "P")\r
118 -  (notmuch-pick-close-message-window)\r
119 -  (with-current-notmuch-pick-message\r
120 -   (notmuch-mua-new-forward-message prompt-for-sender)))\r
121 -\r
122 -(defun notmuch-pick-reply (&optional prompt-for-sender)\r
123 -  "Reply to the sender and all recipients of the current message."\r
124 -  (interactive "P")\r
125 -  (notmuch-pick-close-message-window)\r
126 -  (notmuch-mua-new-reply (notmuch-pick-get-message-id) prompt-for-sender t))\r
127 -\r
128 -(defun notmuch-pick-reply-sender (&optional prompt-for-sender)\r
129 -  "Reply to the sender of the current message."\r
130 -  (interactive "P")\r
131 -  (notmuch-pick-close-message-window)\r
132 -  (notmuch-mua-new-reply (notmuch-pick-get-message-id) prompt-for-sender nil))\r
133 -\r
134  (defun notmuch-pick-clean-address (address)\r
135    "Try to clean a single email ADDRESS for display. Return\r
136  AUTHOR_NAME if present, otherwise return AUTHOR_EMAIL. Return\r
137 -- \r
138 1.7.9.1\r
139 \r