[PATCH v4 7/8] emacs: Fix navigation of multi-line search result formats
authorAustin Clements <amdragon@MIT.EDU>
Sat, 21 Jul 2012 17:37:11 +0000 (13:37 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:26 +0000 (09:48 -0800)
40/1204f8e8d1a3e9908bba3d91bcabf27094a2b0 [new file with mode: 0644]

diff --git a/40/1204f8e8d1a3e9908bba3d91bcabf27094a2b0 b/40/1204f8e8d1a3e9908bba3d91bcabf27094a2b0
new file mode 100644 (file)
index 0000000..32cd0af
--- /dev/null
@@ -0,0 +1,123 @@
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 6B38F431FC9\r
+       for <notmuch@notmuchmail.org>; Sat, 21 Jul 2012 10:37:20 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 9MsC3bVDaKTR for <notmuch@notmuchmail.org>;\r
+       Sat, 21 Jul 2012 10:37:19 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU\r
+       [18.7.68.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id A7773431FAE\r
+       for <notmuch@notmuchmail.org>; Sat, 21 Jul 2012 10:37:19 -0700 (PDT)\r
+X-AuditID: 12074422-b7f1f6d00000090b-93-500ae8ce7185\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+       by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 8F.D1.02315.EC8EA005; Sat, 21 Jul 2012 13:37:18 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q6LHbHQ0018464; \r
+       Sat, 21 Jul 2012 13:37:17 -0400\r
+Received: from drake.dyndns.org\r
+       (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+       [209.6.116.242]) (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q6LHbFgQ008019\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Sat, 21 Jul 2012 13:37:16 -0400 (EDT)\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1SsdcB-0001Zu-GG; Sat, 21 Jul 2012 13:37:15 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v4 7/8] emacs: Fix navigation of multi-line search result\r
+       formats\r
+Date: Sat, 21 Jul 2012 13:37:11 -0400\r
+Message-Id: <1342892232-5659-8-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.10\r
+In-Reply-To: <1342892232-5659-1-git-send-email-amdragon@mit.edu>\r
+References: <1341354059-29396-1-git-send-email-amdragon@mit.edu>\r
+       <1342892232-5659-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFjrKIsWRmVeSWpSXmKPExsUixCmqrXvuBVeAQf8kCYs9+7wsVs/lsbh+\r
+       cyazA7PH3dNcHjtn3WX3eLbqFnMAcxSXTUpqTmZZapG+XQJXxrdjq9gLJvBWTLz2m62B8SZX\r
+       FyMnh4SAiUTjhttMELaYxIV769m6GLk4hAT2MUo8eniWGcLZwChx6d9HKOcRk8S5Je+ZIJy5\r
+       jBIbV20G62cT0JDYtn85I4gtIiAtsfPubFYQm1kgTeJ7+1uwuLBAoMTuB1PZQWwWAVWJ89dP\r
+       g9m8AvYSV7fsY4a4Q17i6f0+NhCbU8BB4tHZAywgtpBAmcTijsOMExj5FzAyrGKUTcmt0s1N\r
+       zMwpTk3WLU5OzMtLLdI11cvNLNFLTSndxAgKLXYXpR2MPw8qHWIU4GBU4uH1mMUZIMSaWFZc\r
+       mXuIUZKDSUmUt+8+V4AQX1J+SmVGYnFGfFFpTmrxIUYJDmYlEd5Np4FyvCmJlVWpRfkwKWkO\r
+       FiVx3mspN/2FBNITS1KzU1MLUotgsjIcHEoSvO7AGBISLEpNT61Iy8wpQUgzcXCCDOcBGi4G\r
+       UsNbXJCYW5yZDpE/xagoJc5rB5IQAElklObB9cJi/xWjONArwrzfngNV8QDTBlz3K6DBTECD\r
+       pbPABpckIqSkGhjz10emm1oXxtxZfqw2Wm72nMlN+vpW96Nfan54dz/zZfOUvxeePbjb3rRl\r
+       mc+cO1e4Hl9X/uB1c+eXd7c81ZI2Lz0YvvdYVOKLg5Ll924qO4jFWrHeSWLbZSTu8bAl2rvv\r
+       QNytW3c0io7vkzY5Zl+j2TSf7cq7MJlnK7wqLbwfTf+1ud1U8aGCEktxRqKhFnNRcSIAK2SZ\r
+       NtgCAAA=\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 21 Jul 2012 17:37:20 -0000\r
+\r
+At this point, the only remaining functions that don't support\r
+multi-line search result formats are the thread navigation functions.\r
+This patch fixes that by rewriting them in terms of\r
+notmuch-search-result-{beginning,end}.\r
+\r
+This changes the behavior of notmuch-search-previous-thread slightly\r
+so that if point isn't at the beginning of a result, it first moves\r
+point to the beginning of the result.\r
+---\r
+ emacs/notmuch.el |   13 ++++++++++---\r
+ 1 file changed, 10 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index d092528..fd1836f 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -293,18 +293,25 @@ For a mouse binding, return nil."\r
+ (defun notmuch-search-next-thread ()\r
+   "Select the next thread in the search results."\r
+   (interactive)\r
+-  (forward-line 1))\r
++  (when (notmuch-search-get-result (notmuch-search-result-end))\r
++    (goto-char (notmuch-search-result-end))))\r
+ \r
+ (defun notmuch-search-previous-thread ()\r
+   "Select the previous thread in the search results."\r
+   (interactive)\r
+-  (forward-line -1))\r
++  (if (notmuch-search-get-result)\r
++      (unless (bobp)\r
++      (goto-char (notmuch-search-result-beginning (- (point) 1))))\r
++    ;; We must be past the end; jump to the last result\r
++    (notmuch-search-last-thread)))\r
+ \r
+ (defun notmuch-search-last-thread ()\r
+   "Select the last thread in the search results."\r
+   (interactive)\r
+   (goto-char (point-max))\r
+-  (forward-line -2))\r
++  (forward-line -2)\r
++  (let ((beg (notmuch-search-result-beginning)))\r
++    (when beg (goto-char beg))))\r
+ \r
+ (defun notmuch-search-first-thread ()\r
+   "Select the first thread in the search results."\r
+-- \r
+1.7.10\r
+\r