Re: Applying patches directly from emails?
[notmuch-archives.git] / 15 / e232ced261a35d0b681246441853586f20c00e
1 Return-Path: <m.walters@qmul.ac.uk>\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 1CAF4431FC0\r
6         for <notmuch@notmuchmail.org>; Sat, 25 May 2013 06:40:13 -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: -1.098\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 4RxFfS5QfqrC for <notmuch@notmuchmail.org>;\r
17         Sat, 25 May 2013 06:40:05 -0700 (PDT)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id A4103431FAF\r
22         for <notmuch@notmuchmail.org>; Sat, 25 May 2013 06:40:04 -0700 (PDT)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1UgEhU-0001wB-9e; Sat, 25 May 2013 14:40:00 +0100\r
27 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
28         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
29         (envelope-from <m.walters@qmul.ac.uk>)\r
30         id 1UgEhT-0001X3-Se; Sat, 25 May 2013 14:40:00 +0100\r
31 From: Mark Walters <markwalters1009@gmail.com>\r
32 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
33 Subject: Re: [PATCH 1/2] emacs: add show view bindings to move to\r
34         previous/next thread\r
35 In-Reply-To: <1369484066-20228-1-git-send-email-jani@nikula.org>\r
36 References: <1369484066-20228-1-git-send-email-jani@nikula.org>\r
37 User-Agent: Notmuch/0.14+255~gff3cc55 (http://notmuchmail.org) Emacs/23.4.1\r
38         (x86_64-pc-linux-gnu)\r
39 Date: Sat, 25 May 2013 14:39:58 +0100\r
40 Message-ID: <87a9nj2n69.fsf@qmul.ac.uk>\r
41 MIME-Version: 1.0\r
42 Content-Type: text/plain; charset=us-ascii\r
43 X-Sender-Host-Address: 93.97.24.31\r
44 X-QM-SPAM-Info: Sender has good ham record.  :)\r
45 X-QM-Body-MD5: 21e0656bcbfbc012ffb950adb2fc14d7 (of first 20000 bytes)\r
46 X-SpamAssassin-Score: -0.1\r
47 X-SpamAssassin-SpamBar: /\r
48 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
49         determine if it is\r
50         spam. We require at least 5.0 points to mark a message as spam.\r
51         This message scored -0.1 points.\r
52         Summary of the scoring: \r
53         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
54         provider *      (markwalters1009[at]gmail.com)\r
55         * -0.1 AWL AWL: From: address is in the auto white-list\r
56 X-QM-Scan-Virus: ClamAV says the message is clean\r
57 Cc: Tomi Ollila <tomi.ollila@iki.fi>\r
58 X-BeenThere: notmuch@notmuchmail.org\r
59 X-Mailman-Version: 2.1.13\r
60 Precedence: list\r
61 List-Id: "Use and development of the notmuch mail system."\r
62         <notmuch.notmuchmail.org>\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
66 List-Post: <mailto:notmuch@notmuchmail.org>\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
70 X-List-Received-Date: Sat, 25 May 2013 13:40:13 -0000\r
71 \r
72 \r
73 Hi\r
74 \r
75 > We have most of the plumbing in place, add the bindings M-n and M-p.\r
76 >\r
77 > ---\r
78 >\r
79 > v2: reduce duplication by adding PREVIOUS argument to\r
80 >     notmuch-show-next-thread instead of adding a separate function for\r
81 >     moving to previous thread (Mark)\r
82 > ---\r
83 >  emacs/notmuch-show.el |   28 ++++++++++++++++++++++++----\r
84 >  1 file changed, 24 insertions(+), 4 deletions(-)\r
85 >\r
86 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
87 > index d56154e..a903395 100644\r
88 > --- a/emacs/notmuch-show.el\r
89 > +++ b/emacs/notmuch-show.el\r
90 > @@ -39,6 +39,7 @@\r
91 >  \r
92 >  (declare-function notmuch-call-notmuch-process "notmuch" (&rest args))\r
93 >  (declare-function notmuch-search-next-thread "notmuch" nil)\r
94 > +(declare-function notmuch-search-previous-thread "notmuch" nil)\r
95 >  (declare-function notmuch-search-show-thread "notmuch" nil)\r
96 >  \r
97 >  (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")\r
98 > @@ -1273,6 +1274,8 @@ reset based on the original query."\r
99 >       (define-key map "P" 'notmuch-show-previous-message)\r
100 >       (define-key map "n" 'notmuch-show-next-open-message)\r
101 >       (define-key map "p" 'notmuch-show-previous-open-message)\r
102 > +     (define-key map (kbd "M-n") 'notmuch-show-next-thread-show)\r
103 > +     (define-key map (kbd "M-p") 'notmuch-show-previous-thread-show)\r
104 >       (define-key map (kbd "DEL") 'notmuch-show-rewind)\r
105 >       (define-key map " " 'notmuch-show-advance-and-archive)\r
106 >       (define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)\r
107 > @@ -1834,17 +1837,34 @@ argument, hide all of the messages."\r
108 >    (interactive)\r
109 >    (backward-button 1))\r
110 >  \r
111 > -(defun notmuch-show-next-thread (&optional show-next)\r
112 > -  "Move to the next item in the search results, if any."\r
113 > +(defun notmuch-show-next-thread (&optional show previous)\r
114 > +  "Move to the next item in the search results, if any.\r
115 > +\r
116 > +If SHOW is non-nil, open the next item in a show\r
117 > +buffer. Otherwise just highlight the next item in the search\r
118 > +buffer. If PREVIOUS is non-nil, move to the previous item in the\r
119 > +search results instead."\r
120 >    (interactive "P")\r
121 >    (let ((parent-buffer notmuch-show-parent-buffer))\r
122 >      (notmuch-kill-this-buffer)\r
123 >      (when (buffer-live-p parent-buffer)\r
124 >        (switch-to-buffer parent-buffer)\r
125 > -      (notmuch-search-next-thread)\r
126 > -      (if show-next\r
127 > +      (if previous\r
128 > +       (notmuch-search-previous-thread)\r
129 > +     (notmuch-search-next-thread))\r
130 > +      (if show\r
131 >         (notmuch-search-show-thread)))))\r
132 \r
133 Did you want this to not exit back to the search results if you do M-p\r
134 on the first result?  I attach a version below that does exit back (so\r
135 M-p and M-n behave the same.\r
136 \r
137 Best wishes \r
138 \r
139 Mark\r
140 \r
141 >From 22f03457a4c1884d35cf3de32f55977b980b7960 Mon Sep 17 00:00:00 2001\r
142 From: Jani Nikula <jani@nikula.org>\r
143 Date: Sat, 25 May 2013 15:14:25 +0300\r
144 Subject: [PATCH 1/2] emacs: add show view bindings to move to previous/next\r
145  thread\r
146 \r
147 We have most of the plumbing in place, add the bindings M-n and M-p.\r
148 ---\r
149  emacs/notmuch-show.el |   30 +++++++++++++++++++++++++-----\r
150  1 files changed, 25 insertions(+), 5 deletions(-)\r
151 \r
152 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
153 index d56154e..2b33007 100644\r
154 --- a/emacs/notmuch-show.el\r
155 +++ b/emacs/notmuch-show.el\r
156 @@ -39,6 +39,7 @@\r
157  \r
158  (declare-function notmuch-call-notmuch-process "notmuch" (&rest args))\r
159  (declare-function notmuch-search-next-thread "notmuch" nil)\r
160 +(declare-function notmuch-search-previous-thread "notmuch" nil)\r
161  (declare-function notmuch-search-show-thread "notmuch" nil)\r
162  \r
163  (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")\r
164 @@ -1273,6 +1274,8 @@ reset based on the original query."\r
165         (define-key map "P" 'notmuch-show-previous-message)\r
166         (define-key map "n" 'notmuch-show-next-open-message)\r
167         (define-key map "p" 'notmuch-show-previous-open-message)\r
168 +       (define-key map (kbd "M-n") 'notmuch-show-next-thread-show)\r
169 +       (define-key map (kbd "M-p") 'notmuch-show-previous-thread-show)\r
170         (define-key map (kbd "DEL") 'notmuch-show-rewind)\r
171         (define-key map " " 'notmuch-show-advance-and-archive)\r
172         (define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)\r
173 @@ -1834,16 +1837,33 @@ argument, hide all of the messages."\r
174    (interactive)\r
175    (backward-button 1))\r
176  \r
177 -(defun notmuch-show-next-thread (&optional show-next)\r
178 -  "Move to the next item in the search results, if any."\r
179 +(defun notmuch-show-next-thread (&optional show previous)\r
180 +  "Move to the next item in the search results, if any.\r
181 +\r
182 +If SHOW is non-nil, open the next item in a show\r
183 +buffer. Otherwise just highlight the next item in the search\r
184 +buffer. If PREVIOUS is non-nil, move to the previous item in the\r
185 +search results instead."\r
186    (interactive "P")\r
187    (let ((parent-buffer notmuch-show-parent-buffer))\r
188      (notmuch-kill-this-buffer)\r
189      (when (buffer-live-p parent-buffer)\r
190        (switch-to-buffer parent-buffer)\r
191 -      (notmuch-search-next-thread)\r
192 -      (if show-next\r
193 -         (notmuch-search-show-thread)))))\r
194 +      (and (if previous\r
195 +              (notmuch-search-previous-thread)\r
196 +            (notmuch-search-next-thread))\r
197 +          show\r
198 +          (notmuch-search-show-thread)))))\r
199 +\r
200 +(defun notmuch-show-next-thread-show ()\r
201 +  "Show the next thread in the search results, if any."\r
202 +  (interactive)\r
203 +  (notmuch-show-next-thread t))\r
204 +\r
205 +(defun notmuch-show-previous-thread-show ()\r
206 +  "Show the previous thread in the search results, if any."\r
207 +  (interactive)\r
208 +  (notmuch-show-next-thread t t))\r
209  \r
210  (defun notmuch-show-archive-thread (&optional unarchive)\r
211    "Archive each message in thread.\r
212 -- \r
213 1.7.9.1\r
214 \r