[PATCH v2 00/14] reply refactor, fixes
[notmuch-archives.git] / 63 / b1eb5dea9ada47d4be4da893d696d90a95636f
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 BFC3542119C\r
6         for <notmuch@notmuchmail.org>; Fri, 13 Jul 2012 20:43:41 -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: -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 56y1A8wRu6JB for <notmuch@notmuchmail.org>;\r
16         Fri, 13 Jul 2012 20:43:39 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU\r
18         [18.9.25.13])\r
19         by olra.theworths.org (Postfix) with ESMTP id AB122431FC3\r
20         for <notmuch@notmuchmail.org>; Fri, 13 Jul 2012 20:43:39 -0700 (PDT)\r
21 X-AuditID: 1209190d-b7fd56d000000933-f6-5000eaebdbf7\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
23         by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 65.89.02355.BEAE0005; Fri, 13 Jul 2012 23:43:39 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q6E3hdST026808; \r
27         Fri, 13 Jul 2012 23:43:39 -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 q6E3hbQP021334\r
33         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
34         Fri, 13 Jul 2012 23:43:38 -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 1SptGb-0000aA-22; Fri, 13 Jul 2012 23:43:37 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [PATCH v2 7/7] emacs: Fix navigation of multi-line search result\r
41         formats\r
42 Date: Fri, 13 Jul 2012 23:43:26 -0400\r
43 Message-Id: <1342237406-32507-8-git-send-email-amdragon@mit.edu>\r
44 X-Mailer: git-send-email 1.7.10\r
45 In-Reply-To: <1342237406-32507-1-git-send-email-amdragon@mit.edu>\r
46 References: <1342140319-19859-1-git-send-email-amdragon@mit.edu>\r
47         <1342237406-32507-1-git-send-email-amdragon@mit.edu>\r
48 X-Brightmail-Tracker:\r
49  H4sIAAAAAAAAA+NgFtrDIsWRmVeSWpSXmKPExsUixG6nrvv6FUOAwaoXPBar5/JYXL85k9mB\r
50         yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgypi1/wlLwWueikPtIQ2M+7i6GDk5JARMJA5t\r
51         v8sIYYtJXLi3nq2LkYtDSGAfo0Rby1UmCGcDo8Sz1t1QmUdMEqsbd7FAOHMZJQ5+mswC0s8m\r
52         oCGxbf9ysFkiAtISO+/OZgWxmQUcJT7vX8QGYgsLBEosWPWaHcRmEVCVONo4iRnE5hVwkDh6\r
53         6g4rxB3yEk/v94HVcwL1tvXeBpspJFAucf3bGqYJjPwLGBlWMcqm5Fbp5iZm5hSnJusWJyfm\r
54         5aUW6Rrp5WaW6KWmlG5iBAUSpyTvDsZ3B5UOMQpwMCrx8Kb6MwQIsSaWFVfmHmKU5GBSEuXl\r
55         BYahEF9SfkplRmJxRnxRaU5q8SFGCQ5mJRFe8zagHG9KYmVValE+TEqag0VJnPdKyk1/IYH0\r
56         xJLU7NTUgtQimKwMB4eSBK8wyFDBotT01Iq0zJwShDQTByfIcB6g4dIgNbzFBYm5xZnpEPlT\r
57         jIpS4ryXXwIlBEASGaV5cL2wSH/FKA70ijCvDUg7DzBJwHW/AhrMBDR41s9//kCDSxIRUlIN\r
58         jH1RbtNc7ixkvbXknGmAf8ZkH9Yvh81dz9ZtuGXIkNWiK3mG43r33hcVzyPuRm5guv3ht6fE\r
59         udNRJY+urT1rt0r8vez6KRuLri6I/7frv084a+rK95+O3TnIIX+p39zae0LAp/uv5E5wuWeW\r
60         r2J7vidxT5R7/B6X43ab7wTx7K59oHvgw77pH/OVWIozEg21mIuKEwGrUotRzwIAAA==\r
61 X-BeenThere: notmuch@notmuchmail.org\r
62 X-Mailman-Version: 2.1.13\r
63 Precedence: list\r
64 List-Id: "Use and development of the notmuch mail system."\r
65         <notmuch.notmuchmail.org>\r
66 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
67         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
68 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
69 List-Post: <mailto:notmuch@notmuchmail.org>\r
70 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
71 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
72         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
73 X-List-Received-Date: Sat, 14 Jul 2012 03:43:42 -0000\r
74 \r
75 At this point, the only remaining functions that don't support\r
76 multi-line search result formats are the thread navigation functions.\r
77 This patch fixes that by rewriting them in terms of\r
78 notmuch-search-result-{beginning,end}.\r
79 \r
80 This changes the behavior of notmuch-search-previous-thread slightly\r
81 so that if point isn't at the beginning of a result, it first moves\r
82 point to the beginning of the result.\r
83 ---\r
84  emacs/notmuch.el |   12 +++++++++---\r
85  1 file changed, 9 insertions(+), 3 deletions(-)\r
86 \r
87 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
88 index d0a8021..7302fa7 100644\r
89 --- a/emacs/notmuch.el\r
90 +++ b/emacs/notmuch.el\r
91 @@ -287,18 +287,24 @@ For a mouse binding, return nil."\r
92  (defun notmuch-search-next-thread ()\r
93    "Select the next thread in the search results."\r
94    (interactive)\r
95 -  (forward-line 1))\r
96 +  (when (notmuch-search-get-result (notmuch-search-result-end))\r
97 +    (goto-char (notmuch-search-result-end))))\r
98  \r
99  (defun notmuch-search-previous-thread ()\r
100    "Select the previous thread in the search results."\r
101    (interactive)\r
102 -  (forward-line -1))\r
103 +  (if (notmuch-search-get-result)\r
104 +      (unless (bobp)\r
105 +       (goto-char (notmuch-search-result-beginning (- (point) 1))))\r
106 +    ;; We must be past the end; jump to the last result\r
107 +    (notmuch-search-last-thread)))\r
108  \r
109  (defun notmuch-search-last-thread ()\r
110    "Select the last thread in the search results."\r
111    (interactive)\r
112    (goto-char (point-max))\r
113 -  (forward-line -2))\r
114 +  (forward-line -2)\r
115 +  (goto-char (notmuch-search-result-beginning)))\r
116  \r
117  (defun notmuch-search-first-thread ()\r
118    "Select the first thread in the search results."\r
119 -- \r
120 1.7.10\r
121 \r