(no commit message)
[notmuch-archives.git] / cd / 62b38b71cb3581649ee8b9789c83c97105dc68
1 Return-Path: <pieter@praet.org>\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 82EC2429E21\r
6         for <notmuch@notmuchmail.org>; Wed, 16 Nov 2011 14:48:56 -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: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id CqoM+wSI44-g for <notmuch@notmuchmail.org>;\r
16         Wed, 16 Nov 2011 14:48:54 -0800 (PST)\r
17 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
18  [74.125.82.45])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
19  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
20  F409D431FD0    for <notmuch@notmuchmail.org>; Wed, 16 Nov 2011 14:48:53 -0800\r
21  (PST)\r
22 Received: by wwf10 with SMTP id 10so1374802wwf.2\r
23         for <notmuch@notmuchmail.org>; Wed, 16 Nov 2011 14:48:53 -0800 (PST)\r
24 Received: by 10.227.208.147 with SMTP id gc19mr24011191wbb.25.1321483732903;\r
25         Wed, 16 Nov 2011 14:48:52 -0800 (PST)\r
26 Received: from localhost ([109.131.148.49])\r
27         by mx.google.com with ESMTPS id gd6sm34442953wbb.1.2011.11.16.14.48.51\r
28         (version=TLSv1/SSLv3 cipher=OTHER);\r
29         Wed, 16 Nov 2011 14:48:51 -0800 (PST)\r
30 From: Pieter Praet <pieter@praet.org>\r
31 To: Jameson Graef Rollins <jrollins@finestructure.net>\r
32 Subject: Re: [PATCH] emacs: breakout notmuch-show-advance functionality from\r
33         notmuch-show-advance-and-archive\r
34 In-Reply-To: <1321219008-11690-2-git-send-email-jrollins@finestructure.net>\r
35 References: <1321219008-11690-1-git-send-email-jrollins@finestructure.net>\r
36         <1321219008-11690-2-git-send-email-jrollins@finestructure.net>\r
37 User-Agent: Notmuch/0.9+76~g2fd88e6 (http://notmuchmail.org) Emacs/23.3.1\r
38         (x86_64-unknown-linux-gnu)\r
39 Date: Wed, 16 Nov 2011 23:47:53 +0100\r
40 Message-ID: <87r517bs6e.fsf@praet.org>\r
41 MIME-Version: 1.0\r
42 Content-Type: text/plain; charset=us-ascii\r
43 Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
44 X-BeenThere: notmuch@notmuchmail.org\r
45 X-Mailman-Version: 2.1.13\r
46 Precedence: list\r
47 List-Id: "Use and development of the notmuch mail system."\r
48         <notmuch.notmuchmail.org>\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
52 List-Post: <mailto:notmuch@notmuchmail.org>\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
56 X-List-Received-Date: Wed, 16 Nov 2011 22:48:56 -0000\r
57 \r
58 On Sun, 13 Nov 2011 13:16:48 -0800, Jameson Graef Rollins <jrollins@finestructure.net> wrote:\r
59 > This patch breaks out much of the functionality of\r
60 > notmuch-show-advance-and-archive into a new function:\r
61 > notmuch-show-advance.  This new function does all the advancing\r
62 > through a show buffer that notmuch-show-advance-and-archive did,\r
63 > without all the invasive thread archiving.  The return value of\r
64 > notmuch-show-advance is nil if the bottom of the thread is not\r
65 > reached, and t if it is.\r
66\r
67 > notmuch-show-advance-and-archive is modified to just call\r
68 > notmuch-show-advance, and then call notmuch-show-archive-thread if the\r
69 > return value is true.  In this way the previous functionality of\r
70 > notmuch-show-advance-and-archive is preserved.\r
71\r
72 > This provides a way for people to rebind the space bar to a more sane\r
73 > function if they don't like the default behavior.\r
74 > ---\r
75 >  emacs/notmuch-show.el |   38 +++++++++++++++++++++++---------------\r
76 >  1 files changed, 23 insertions(+), 15 deletions(-)\r
77\r
78 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
79 > index d5c95d8..a7f3263 100644\r
80 > --- a/emacs/notmuch-show.el\r
81 > +++ b/emacs/notmuch-show.el\r
82 > @@ -1135,26 +1135,18 @@ All currently available key bindings:\r
83 >  \r
84 >  ;; Commands typically bound to keys.\r
85 >  \r
86 > -(defun notmuch-show-advance-and-archive ()\r
87 > -  "Advance through thread and archive.\r
88 > -\r
89 > -This command is intended to be one of the simplest ways to\r
90 > -process a thread of email. It does the following:\r
91 > +(defun notmuch-show-advance ()\r
92 > +  "Advance through thread.\r
93 >  \r
94 >  If the current message in the thread is not yet fully visible,\r
95 >  scroll by a near screenful to read more of the message.\r
96 >  \r
97 >  Otherwise, (the end of the current message is already within the\r
98 > -current window), advance to the next open message.\r
99 > -\r
100 > -Finally, if there is no further message to advance to, and this\r
101 > -last message is already read, then archive the entire current\r
102 > -thread, (remove the \"inbox\" tag from each message). Also kill\r
103 > -this buffer, and display the next thread from the search from\r
104 > -which this thread was originally shown."\r
105 > +current window), advance to the next open message."\r
106 >    (interactive)\r
107 >    (let* ((end-of-this-message (notmuch-show-message-bottom))\r
108 > -      (visible-end-of-this-message (1- end-of-this-message)))\r
109 > +      (visible-end-of-this-message (1- end-of-this-message))\r
110 > +      (ret nil))\r
111 >      (while (invisible-p visible-end-of-this-message)\r
112 >        (setq visible-end-of-this-message\r
113 >           (previous-single-char-property-change visible-end-of-this-message\r
114 > @@ -1173,8 +1165,24 @@ which this thread was originally shown."\r
115 >        (notmuch-show-next-open-message))\r
116 >  \r
117 >       (t\r
118 > -      ;; This is the last message - archive the thread.\r
119 > -      (notmuch-show-archive-thread)))))\r
120 > +      ;; This is the last message - change the return value\r
121 > +      (setq ret t)))\r
122 > +    ret))\r
123 > +\r
124 > +(defun notmuch-show-advance-and-archive ()\r
125 > +  "Advance through thread and archive.\r
126 > +\r
127 > +This command is intended to be one of the simplest ways to\r
128 > +process a thread of email. It works exactly like\r
129 > +notmuch-show-advance, in that it scrolls through messages in a\r
130 > +show buffer, except that when it gets to the end of the buffer it\r
131 > +archives the entire current thread, (remove the \"inbox\" tag\r
132 > +from each message), kills the buffer, and displays the next\r
133 > +thread from the search from which this thread was originally\r
134 > +shown."\r
135 > +  (interactive)\r
136 > +  (if (notmuch-show-advance)\r
137 > +      (notmuch-show-archive-thread)))\r
138 >  \r
139 >  (defun notmuch-show-rewind ()\r
140 >    "Backup through the thread, (reverse scrolling compared to \\[notmuch-show-advance-and-archive]).\r
141 > -- \r
142 > 1.7.7.1\r
143\r
144 > _______________________________________________\r
145 > notmuch mailing list\r
146 > notmuch@notmuchmail.org\r
147 > http://notmuchmail.org/mailman/listinfo/notmuch\r
148 \r
149 \r
150 Nice one!\r
151 \r
152 Signed-off-by: Pieter Praet <pieter@praet.org>  ;)\r
153 \r
154 \r
155 This has also exposed a pre-existing bug: When the last visible message\r
156 is longer than a screenful and contains a *hidden* signature, you'll\r
157 never get to see the end of it.\r
158 \r
159 The culprit is presumably seeking shelter from the flyswatter @\r
160 `notmuch-show-message-extent' or one of its relatives: Cc'ing our\r
161 resident invisibility guru.\r
162 \r
163 \r
164 Peace\r
165 \r
166 -- \r
167 Pieter\r