Re: [PATCH] emacs: Make moving to the previous message move to the previous boundary
[notmuch-archives.git] / f5 / 613c17ffdef48a977f5aa5d91e51137f6792ab
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 BF286431FB6\r
6         for <notmuch@notmuchmail.org>; Wed, 18 Jul 2012 14:54:58 -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 JpBIvdJ4azrD for <notmuch@notmuchmail.org>;\r
17         Wed, 18 Jul 2012 14:54:58 -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 1ABF3431FAF\r
22         for <notmuch@notmuchmail.org>; Wed, 18 Jul 2012 14:54:58 -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 1SrcCn-00024F-Ea; Wed, 18 Jul 2012 22:54:49 +0100\r
27 Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223]\r
28         helo=localhost)\r
29         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)\r
30         (envelope-from <m.walters@qmul.ac.uk>)\r
31         id 1SrcCn-0001bQ-4l; Wed, 18 Jul 2012 22:54:49 +0100\r
32 From: Mark Walters <markwalters1009@gmail.com>\r
33 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
34 Subject: Re: [PATCH] emacs: Make moving to the previous message move to the\r
35         previous boundary\r
36 In-Reply-To: <1342237668-2489-1-git-send-email-amdragon@mit.edu>\r
37 References: <1342237668-2489-1-git-send-email-amdragon@mit.edu>\r
38 User-Agent: Notmuch/0.13.2+90~g84fa1ef (http://notmuchmail.org) Emacs/23.4.1\r
39         (x86_64-pc-linux-gnu)\r
40 Date: Wed, 18 Jul 2012 22:54:48 +0100\r
41 Message-ID: <87sjcod9av.fsf@qmul.ac.uk>\r
42 MIME-Version: 1.0\r
43 Content-Type: text/plain; charset=us-ascii\r
44 X-Sender-Host-Address: 94.192.233.223\r
45 X-QM-SPAM-Info: Sender has good ham record.  :)\r
46 X-QM-Body-MD5: 4648ca5fd1a1c0bef1bbd607d0bab38e (of first 20000 bytes)\r
47 X-SpamAssassin-Score: -1.8\r
48 X-SpamAssassin-SpamBar: -\r
49 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
50         determine if it is\r
51         spam. We require at least 5.0 points to mark a message as spam.\r
52         This message scored -1.8 points.\r
53         Summary of the scoring: \r
54         * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
55         *      medium trust\r
56         *      [138.37.6.40 listed in list.dnswl.org]\r
57         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
58         provider *      (markwalters1009[at]gmail.com)\r
59         * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay\r
60         *      domain\r
61         *  0.5 AWL AWL: From: address is in the auto white-list\r
62 X-QM-Scan-Virus: ClamAV says the message is clean\r
63 X-BeenThere: notmuch@notmuchmail.org\r
64 X-Mailman-Version: 2.1.13\r
65 Precedence: list\r
66 List-Id: "Use and development of the notmuch mail system."\r
67         <notmuch.notmuchmail.org>\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
71 List-Post: <mailto:notmuch@notmuchmail.org>\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
74         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
75 X-List-Received-Date: Wed, 18 Jul 2012 21:54:58 -0000\r
76 \r
77 On Sat, 14 Jul 2012, Austin Clements <amdragon@MIT.EDU> wrote:\r
78 > Previously, notmuch-show-previous-message would move to the beginning\r
79 > of the message before the message containing point.  This patch makes\r
80 > it instead move to the previous message *boundary*.  That is, if point\r
81 > isn't already at the beginning of the message, it moves to the\r
82 > beginning of the current message.  This is consistent with\r
83 > notmuch-show-next-message, which can be thought of as moving to the\r
84 > next message boundary.  Several people have expressed a preference for\r
85 > this.\r
86 \r
87 I like this change: the current behaviour has mildly confused/annoyed me\r
88 in the past.\r
89 \r
90 >\r
91 > This patch accompanies the series in [0] (though they're independent\r
92 > and can be applied in either order).  This makes the behavior of 'p'\r
93 > and 'P' in show-mode conceptually similar to the new behavior of 'p'\r
94 > in search-mode.\r
95 >\r
96 > [0] 1342140319-19859-1-git-send-email-amdragon@mit.edu\r
97 >\r
98 >  emacs/notmuch-show.el |   10 +++++++---\r
99 >  1 file changed, 7 insertions(+), 3 deletions(-)\r
100 >\r
101 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
102 > index 6335d45..02e319f 100644\r
103 > --- a/emacs/notmuch-show.el\r
104 > +++ b/emacs/notmuch-show.el\r
105 > @@ -1525,9 +1525,11 @@ thread, navigate to the next thread in the parent search buffer."\r
106 >        (goto-char (point-max)))))\r
107 >  \r
108 >  (defun notmuch-show-previous-message ()\r
109 > -  "Show the previous message."\r
110 > +  "Show the previous message or the start of the current message."\r
111 >    (interactive)\r
112 > -  (notmuch-show-goto-message-previous)\r
113 > +  (if (= (point) (notmuch-show-message-top))\r
114 > +      (notmuch-show-goto-message-previous)\r
115 > +    (notmuch-show-move-to-message-top))\r
116 >    (notmuch-show-mark-read)\r
117 >    (notmuch-show-message-adjust))\r
118 >  \r
119 > @@ -1587,7 +1589,9 @@ to show, nil otherwise."\r
120 >  (defun notmuch-show-previous-open-message ()\r
121 >    "Show the previous open message."\r
122 >    (interactive)\r
123 > -  (while (and (notmuch-show-goto-message-previous)\r
124 > +  (while (and (if (= (point) (notmuch-show-message-top))\r
125 > +               (notmuch-show-goto-message-previous)\r
126 > +             (notmuch-show-move-to-message-top))\r
127 >             (not (notmuch-show-message-visible-p))))\r
128 >    (notmuch-show-mark-read)\r
129 >    (notmuch-show-message-adjust))\r
130 \r
131 I would mildly prefer taking the testing for top of message out of the\r
132 loop (I know it's one line longer) as\r
133 \r
134   (if (= (point) (notmuch-show-message-top))\r
135       (notmuch-show-goto-message-previous)\r
136     (notmuch-show-move-to-message-top))\r
137   (while (and (not (notmuch-show-message-visible-p))\r
138               (notmuch-show-goto-message-previous)))\r
139 \r
140 but its obviously fine as is.\r
141 \r
142 Best wishes\r
143 \r
144 Mark\r