1 Return-Path: <jrollins@finestructure.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 762B7429E2F
\r
6 for <notmuch@notmuchmail.org>; Sun, 13 Nov 2011 13:17:02 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_MED=-2.3] 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 jYl0Aq6dWqoU for <notmuch@notmuchmail.org>;
\r
16 Sun, 13 Nov 2011 13:17:00 -0800 (PST)
\r
17 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu
\r
19 by olra.theworths.org (Postfix) with ESMTP id 15BEF429E21
\r
20 for <notmuch@notmuchmail.org>; Sun, 13 Nov 2011 13:17:00 -0800 (PST)
\r
21 Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])
\r
22 by earth-doxen-postvirus (Postfix) with ESMTP id B8FB566E0108
\r
23 for <notmuch@notmuchmail.org>; Sun, 13 Nov 2011 13:16:59 -0800 (PST)
\r
24 X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new
\r
25 Received: from finestructure.net (cpe-76-174-136-149.socal.res.rr.com
\r
26 [76.174.136.149]) (Authenticated sender: jrollins)
\r
27 by earth-doxen-submit (Postfix) with ESMTP id 65FC166E0107
\r
28 for <notmuch@notmuchmail.org>; Sun, 13 Nov 2011 13:16:57 -0800 (PST)
\r
29 Received: by finestructure.net (Postfix, from userid 1000)
\r
30 id 00AD11243; Sun, 13 Nov 2011 13:16:56 -0800 (PST)
\r
31 From: Jameson Graef Rollins <jrollins@finestructure.net>
\r
32 To: Notmuch Mail <notmuch@notmuchmail.org>
\r
33 Subject: [PATCH] emacs: breakout notmuch-show-advance functionality from
\r
34 notmuch-show-advance-and-archive
\r
35 Date: Sun, 13 Nov 2011 13:16:48 -0800
\r
36 Message-Id: <1321219008-11690-2-git-send-email-jrollins@finestructure.net>
\r
37 X-Mailer: git-send-email 1.7.7.1
\r
38 In-Reply-To: <1321219008-11690-1-git-send-email-jrollins@finestructure.net>
\r
39 References: <1321219008-11690-1-git-send-email-jrollins@finestructure.net>
\r
40 X-BeenThere: notmuch@notmuchmail.org
\r
41 X-Mailman-Version: 2.1.13
\r
43 List-Id: "Use and development of the notmuch mail system."
\r
44 <notmuch.notmuchmail.org>
\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
48 List-Post: <mailto:notmuch@notmuchmail.org>
\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
52 X-List-Received-Date: Sun, 13 Nov 2011 21:17:03 -0000
\r
54 This patch breaks out much of the functionality of
\r
55 notmuch-show-advance-and-archive into a new function:
\r
56 notmuch-show-advance. This new function does all the advancing
\r
57 through a show buffer that notmuch-show-advance-and-archive did,
\r
58 without all the invasive thread archiving. The return value of
\r
59 notmuch-show-advance is nil if the bottom of the thread is not
\r
60 reached, and t if it is.
\r
62 notmuch-show-advance-and-archive is modified to just call
\r
63 notmuch-show-advance, and then call notmuch-show-archive-thread if the
\r
64 return value is true. In this way the previous functionality of
\r
65 notmuch-show-advance-and-archive is preserved.
\r
67 This provides a way for people to rebind the space bar to a more sane
\r
68 function if they don't like the default behavior.
\r
70 emacs/notmuch-show.el | 38 +++++++++++++++++++++++---------------
\r
71 1 files changed, 23 insertions(+), 15 deletions(-)
\r
73 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
74 index d5c95d8..a7f3263 100644
\r
75 --- a/emacs/notmuch-show.el
\r
76 +++ b/emacs/notmuch-show.el
\r
77 @@ -1135,26 +1135,18 @@ All currently available key bindings:
\r
79 ;; Commands typically bound to keys.
\r
81 -(defun notmuch-show-advance-and-archive ()
\r
82 - "Advance through thread and archive.
\r
84 -This command is intended to be one of the simplest ways to
\r
85 -process a thread of email. It does the following:
\r
86 +(defun notmuch-show-advance ()
\r
87 + "Advance through thread.
\r
89 If the current message in the thread is not yet fully visible,
\r
90 scroll by a near screenful to read more of the message.
\r
92 Otherwise, (the end of the current message is already within the
\r
93 -current window), advance to the next open message.
\r
95 -Finally, if there is no further message to advance to, and this
\r
96 -last message is already read, then archive the entire current
\r
97 -thread, (remove the \"inbox\" tag from each message). Also kill
\r
98 -this buffer, and display the next thread from the search from
\r
99 -which this thread was originally shown."
\r
100 +current window), advance to the next open message."
\r
102 (let* ((end-of-this-message (notmuch-show-message-bottom))
\r
103 - (visible-end-of-this-message (1- end-of-this-message)))
\r
104 + (visible-end-of-this-message (1- end-of-this-message))
\r
106 (while (invisible-p visible-end-of-this-message)
\r
107 (setq visible-end-of-this-message
\r
108 (previous-single-char-property-change visible-end-of-this-message
\r
109 @@ -1173,8 +1165,24 @@ which this thread was originally shown."
\r
110 (notmuch-show-next-open-message))
\r
113 - ;; This is the last message - archive the thread.
\r
114 - (notmuch-show-archive-thread)))))
\r
115 + ;; This is the last message - change the return value
\r
119 +(defun notmuch-show-advance-and-archive ()
\r
120 + "Advance through thread and archive.
\r
122 +This command is intended to be one of the simplest ways to
\r
123 +process a thread of email. It works exactly like
\r
124 +notmuch-show-advance, in that it scrolls through messages in a
\r
125 +show buffer, except that when it gets to the end of the buffer it
\r
126 +archives the entire current thread, (remove the \"inbox\" tag
\r
127 +from each message), kills the buffer, and displays the next
\r
128 +thread from the search from which this thread was originally
\r
131 + (if (notmuch-show-advance)
\r
132 + (notmuch-show-archive-thread)))
\r
134 (defun notmuch-show-rewind ()
\r
135 "Backup through the thread, (reverse scrolling compared to \\[notmuch-show-advance-and-archive]).
\r