1 Return-Path: <amdragon@mit.edu>
\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 6B38F431FC9
\r
6 for <notmuch@notmuchmail.org>; Sat, 21 Jul 2012 10:37:20 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 9MsC3bVDaKTR for <notmuch@notmuchmail.org>;
\r
16 Sat, 21 Jul 2012 10:37:19 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id A7773431FAE
\r
20 for <notmuch@notmuchmail.org>; Sat, 21 Jul 2012 10:37:19 -0700 (PDT)
\r
21 X-AuditID: 12074422-b7f1f6d00000090b-93-500ae8ce7185
\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])
\r
23 by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 8F.D1.02315.EC8EA005; Sat, 21 Jul 2012 13:37:18 -0400 (EDT)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q6LHbHQ0018464;
\r
27 Sat, 21 Jul 2012 13:37:17 -0400
\r
28 Received: from drake.dyndns.org
\r
29 (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com
\r
30 [209.6.116.242]) (authenticated bits=0)
\r
31 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
32 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q6LHbFgQ008019
\r
33 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
34 Sat, 21 Jul 2012 13:37:16 -0400 (EDT)
\r
35 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)
\r
36 (envelope-from <amdragon@mit.edu>)
\r
37 id 1SsdcB-0001Zu-GG; Sat, 21 Jul 2012 13:37:15 -0400
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH v4 7/8] emacs: Fix navigation of multi-line search result
\r
42 Date: Sat, 21 Jul 2012 13:37:11 -0400
\r
43 Message-Id: <1342892232-5659-8-git-send-email-amdragon@mit.edu>
\r
44 X-Mailer: git-send-email 1.7.10
\r
45 In-Reply-To: <1342892232-5659-1-git-send-email-amdragon@mit.edu>
\r
46 References: <1341354059-29396-1-git-send-email-amdragon@mit.edu>
\r
47 <1342892232-5659-1-git-send-email-amdragon@mit.edu>
\r
48 X-Brightmail-Tracker:
\r
49 H4sIAAAAAAAAA+NgFjrKIsWRmVeSWpSXmKPExsUixCmqrXvuBVeAQf8kCYs9+7wsVs/lsbh+
\r
50 cyazA7PH3dNcHjtn3WX3eLbqFnMAcxSXTUpqTmZZapG+XQJXxrdjq9gLJvBWTLz2m62B8SZX
\r
51 FyMnh4SAiUTjhttMELaYxIV769m6GLk4hAT2MUo8eniWGcLZwChx6d9HKOcRk8S5Je+ZIJy5
\r
52 jBIbV20G62cT0JDYtn85I4gtIiAtsfPubFYQm1kgTeJ7+1uwuLBAoMTuB1PZQWwWAVWJ89dP
\r
53 g9m8AvYSV7fsY4a4Q17i6f0+NhCbU8BB4tHZAywgtpBAmcTijsOMExj5FzAyrGKUTcmt0s1N
\r
54 zMwpTk3WLU5OzMtLLdI11cvNLNFLTSndxAgKLXYXpR2MPw8qHWIU4GBU4uH1mMUZIMSaWFZc
\r
55 mXuIUZKDSUmUt+8+V4AQX1J+SmVGYnFGfFFpTmrxIUYJDmYlEd5Np4FyvCmJlVWpRfkwKWkO
\r
56 FiVx3mspN/2FBNITS1KzU1MLUotgsjIcHEoSvO7AGBISLEpNT61Iy8wpQUgzcXCCDOcBGi4G
\r
57 UsNbXJCYW5yZDpE/xagoJc5rB5IQAElklObB9cJi/xWjONArwrzfngNV8QDTBlz3K6DBTECD
\r
58 pbPABpckIqSkGhjz10emm1oXxtxZfqw2Wm72nMlN+vpW96Nfan54dz/zZfOUvxeePbjb3rRl
\r
59 mc+cO1e4Hl9X/uB1c+eXd7c81ZI2Lz0YvvdYVOKLg5Ll924qO4jFWrHeSWLbZSTu8bAl2rvv
\r
60 QNytW3c0io7vkzY5Zl+j2TSf7cq7MJlnK7wqLbwfTf+1ud1U8aGCEktxRqKhFnNRcSIAK2SZ
\r
62 X-BeenThere: notmuch@notmuchmail.org
\r
63 X-Mailman-Version: 2.1.13
\r
65 List-Id: "Use and development of the notmuch mail system."
\r
66 <notmuch.notmuchmail.org>
\r
67 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
68 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
69 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
70 List-Post: <mailto:notmuch@notmuchmail.org>
\r
71 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
72 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
73 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
74 X-List-Received-Date: Sat, 21 Jul 2012 17:37:20 -0000
\r
76 At this point, the only remaining functions that don't support
\r
77 multi-line search result formats are the thread navigation functions.
\r
78 This patch fixes that by rewriting them in terms of
\r
79 notmuch-search-result-{beginning,end}.
\r
81 This changes the behavior of notmuch-search-previous-thread slightly
\r
82 so that if point isn't at the beginning of a result, it first moves
\r
83 point to the beginning of the result.
\r
85 emacs/notmuch.el | 13 ++++++++++---
\r
86 1 file changed, 10 insertions(+), 3 deletions(-)
\r
88 diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
89 index d092528..fd1836f 100644
\r
90 --- a/emacs/notmuch.el
\r
91 +++ b/emacs/notmuch.el
\r
92 @@ -293,18 +293,25 @@ For a mouse binding, return nil."
\r
93 (defun notmuch-search-next-thread ()
\r
94 "Select the next thread in the search results."
\r
97 + (when (notmuch-search-get-result (notmuch-search-result-end))
\r
98 + (goto-char (notmuch-search-result-end))))
\r
100 (defun notmuch-search-previous-thread ()
\r
101 "Select the previous thread in the search results."
\r
103 - (forward-line -1))
\r
104 + (if (notmuch-search-get-result)
\r
106 + (goto-char (notmuch-search-result-beginning (- (point) 1))))
\r
107 + ;; We must be past the end; jump to the last result
\r
108 + (notmuch-search-last-thread)))
\r
110 (defun notmuch-search-last-thread ()
\r
111 "Select the last thread in the search results."
\r
113 (goto-char (point-max))
\r
114 - (forward-line -2))
\r
115 + (forward-line -2)
\r
116 + (let ((beg (notmuch-search-result-beginning)))
\r
117 + (when beg (goto-char beg))))
\r
119 (defun notmuch-search-first-thread ()
\r
120 "Select the first thread in the search results."
\r