From 9637a817c2d8f191795e186c5a173085ff37fe3a Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sat, 14 Jul 2012 23:43:26 +2000 Subject: [PATCH] [PATCH v2 7/7] emacs: Fix navigation of multi-line search result formats --- 63/b1eb5dea9ada47d4be4da893d696d90a95636f | 121 ++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 63/b1eb5dea9ada47d4be4da893d696d90a95636f diff --git a/63/b1eb5dea9ada47d4be4da893d696d90a95636f b/63/b1eb5dea9ada47d4be4da893d696d90a95636f new file mode 100644 index 000000000..b1b86a4df --- /dev/null +++ b/63/b1eb5dea9ada47d4be4da893d696d90a95636f @@ -0,0 +1,121 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id BFC3542119C + for ; Fri, 13 Jul 2012 20:43:41 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 56y1A8wRu6JB for ; + Fri, 13 Jul 2012 20:43:39 -0700 (PDT) +Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU + [18.9.25.13]) + by olra.theworths.org (Postfix) with ESMTP id AB122431FC3 + for ; Fri, 13 Jul 2012 20:43:39 -0700 (PDT) +X-AuditID: 1209190d-b7fd56d000000933-f6-5000eaebdbf7 +Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) + by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP + id 65.89.02355.BEAE0005; Fri, 13 Jul 2012 23:43:39 -0400 (EDT) +Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) + by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q6E3hdST026808; + Fri, 13 Jul 2012 23:43:39 -0400 +Received: from drake.dyndns.org + (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com + [209.6.116.242]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q6E3hbQP021334 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Fri, 13 Jul 2012 23:43:38 -0400 (EDT) +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1SptGb-0000aA-22; Fri, 13 Jul 2012 23:43:37 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH v2 7/7] emacs: Fix navigation of multi-line search result + formats +Date: Fri, 13 Jul 2012 23:43:26 -0400 +Message-Id: <1342237406-32507-8-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.7.10 +In-Reply-To: <1342237406-32507-1-git-send-email-amdragon@mit.edu> +References: <1342140319-19859-1-git-send-email-amdragon@mit.edu> + <1342237406-32507-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFtrDIsWRmVeSWpSXmKPExsUixG6nrvv6FUOAwaoXPBar5/JYXL85k9mB + yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgypi1/wlLwWueikPtIQ2M+7i6GDk5JARMJA5t + v8sIYYtJXLi3nq2LkYtDSGAfo0Rby1UmCGcDo8Sz1t1QmUdMEqsbd7FAOHMZJQ5+mswC0s8m + oCGxbf9ysFkiAtISO+/OZgWxmQUcJT7vX8QGYgsLBEosWPWaHcRmEVCVONo4iRnE5hVwkDh6 + 6g4rxB3yEk/v94HVcwL1tvXeBpspJFAucf3bGqYJjPwLGBlWMcqm5Fbp5iZm5hSnJusWJyfm + 5aUW6Rrp5WaW6KWmlG5iBAUSpyTvDsZ3B5UOMQpwMCrx8Kb6MwQIsSaWFVfmHmKU5GBSEuXl + BYahEF9SfkplRmJxRnxRaU5q8SFGCQ5mJRFe8zagHG9KYmVValE+TEqag0VJnPdKyk1/IYH0 + xJLU7NTUgtQimKwMB4eSBK8wyFDBotT01Iq0zJwShDQTByfIcB6g4dIgNbzFBYm5xZnpEPlT + jIpS4ryXXwIlBEASGaV5cL2wSH/FKA70ijCvDUg7DzBJwHW/AhrMBDR41s9//kCDSxIRUlIN + jH1RbtNc7ixkvbXknGmAf8ZkH9Yvh81dz9ZtuGXIkNWiK3mG43r33hcVzyPuRm5guv3ht6fE + udNRJY+urT1rt0r8vez6KRuLri6I/7frv084a+rK95+O3TnIIX+p39zae0LAp/uv5E5wuWeW + r2J7vidxT5R7/B6X43ab7wTx7K59oHvgw77pH/OVWIozEg21mIuKEwGrUotRzwIAAA== +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 14 Jul 2012 03:43:42 -0000 + +At this point, the only remaining functions that don't support +multi-line search result formats are the thread navigation functions. +This patch fixes that by rewriting them in terms of +notmuch-search-result-{beginning,end}. + +This changes the behavior of notmuch-search-previous-thread slightly +so that if point isn't at the beginning of a result, it first moves +point to the beginning of the result. +--- + emacs/notmuch.el | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index d0a8021..7302fa7 100644 +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -287,18 +287,24 @@ For a mouse binding, return nil." + (defun notmuch-search-next-thread () + "Select the next thread in the search results." + (interactive) +- (forward-line 1)) ++ (when (notmuch-search-get-result (notmuch-search-result-end)) ++ (goto-char (notmuch-search-result-end)))) + + (defun notmuch-search-previous-thread () + "Select the previous thread in the search results." + (interactive) +- (forward-line -1)) ++ (if (notmuch-search-get-result) ++ (unless (bobp) ++ (goto-char (notmuch-search-result-beginning (- (point) 1)))) ++ ;; We must be past the end; jump to the last result ++ (notmuch-search-last-thread))) + + (defun notmuch-search-last-thread () + "Select the last thread in the search results." + (interactive) + (goto-char (point-max)) +- (forward-line -2)) ++ (forward-line -2) ++ (goto-char (notmuch-search-result-beginning))) + + (defun notmuch-search-first-thread () + "Select the first thread in the search results." +-- +1.7.10 + -- 2.26.2