Re: [PATCH] emacs: fix a bug introduced by the recent search cleanups.
authorAustin Clements <amdragon@MIT.EDU>
Thu, 2 Aug 2012 14:22:14 +0000 (10:22 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:44 +0000 (09:48 -0800)
95/a3d87867f139160a416525288858e32e2ecd2c [new file with mode: 0644]

diff --git a/95/a3d87867f139160a416525288858e32e2ecd2c b/95/a3d87867f139160a416525288858e32e2ecd2c
new file mode 100644 (file)
index 0000000..d4dd584
--- /dev/null
@@ -0,0 +1,142 @@
+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 B584E431FAF\r
+       for <notmuch@notmuchmail.org>; Thu,  2 Aug 2012 07:22:19 -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 08LuxdKi2KLy for <notmuch@notmuchmail.org>;\r
+       Thu,  2 Aug 2012 07:22:19 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU\r
+       [18.7.68.36])\r
+       by olra.theworths.org (Postfix) with ESMTP id D1C70431FAE\r
+       for <notmuch@notmuchmail.org>; Thu,  2 Aug 2012 07:22:18 -0700 (PDT)\r
+X-AuditID: 12074424-b7fa06d0000008c2-62-501a8d198c19\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+       by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id A1.30.02242.91D8A105; Thu,  2 Aug 2012 10:22: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 q72EMGCZ029728; \r
+       Thu, 2 Aug 2012 10:22:16 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (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 q72EMEj3010218\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Thu, 2 Aug 2012 10:22:15 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1SwwI2-000507-JO; Thu, 02 Aug 2012 10:22:14 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Mark Walters <markwalters1009@gmail.com>, Jani Nikula <jani@nikula.org>,\r
+       notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] emacs: fix a bug introduced by the recent search\r
+ cleanups.\r
+In-Reply-To: <87r4rpsquu.fsf@qmul.ac.uk>\r
+References: <1341354059-29396-1-git-send-email-amdragon@mit.edu>\r
+       <1342892232-5659-1-git-send-email-amdragon@mit.edu>\r
+       <1342892232-5659-8-git-send-email-amdragon@mit.edu>\r
+       <87mx2dais8.fsf@nikula.org> <87r4rpsquu.fsf@qmul.ac.uk>\r
+User-Agent: Notmuch/0.13.2+59~g78b98ba (http://notmuchmail.org) Emacs/23.3.1\r
+       (i486-pc-linux-gnu)\r
+Date: Thu, 02 Aug 2012 10:22:14 -0400\r
+Message-ID: <87y5lxnzl5.fsf@awakening.csail.mit.edu>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFvrDIsWRmVeSWpSXmKPExsUixCmqrSvVKxVgsOsnk0XTdGeLPfu8LFbP\r
+       5bG4fnMmswOLx93TXB47Z91l97h1/zW7x7NVt5gDWKK4bFJSczLLUov07RK4MnY9fspcsFuk\r
+       Yt+fWUwNjHcEuhg5OSQETCT+/T3KDmGLSVy4t56ti5GLQ0hgH6PEzGcnWCGc9YwSq5etZIRw\r
+       TjBJPF5yAKpsCaPEzp9dzCD9bAIaEtv2L2cEsUUEciXmvJ3NCmIzC5hJNHftYuli5OAQFvCX\r
+       eHg2EyTMCVR+qvEjE4gtJPCAUaK5wx2kRFQgQeLg8RqQMIuAqsTTJ+/YQGxeoEt33P/HCmEL\r
+       Spyc+YQFYrqWxI1/L5kmMArOQpKahSS1gJFpFaNsSm6Vbm5iZk5xarJucXJiXl5qka65Xm5m\r
+       iV5qSukmRlAgs7uo7GBsPqR0iFGAg1GJh3dzqWSAEGtiWXFl7iFGSQ4mJVHe911SAUJ8Sfkp\r
+       lRmJxRnxRaU5qcWHGCU4mJVEeO/HAuV4UxIrq1KL8mFS0hwsSuK811Nu+gsJpCeWpGanphak\r
+       FsFkZTg4lCR483uAGgWLUtNTK9Iyc0oQ0kwcnCDDeYCGh4HU8BYXJOYWZ6ZD5E8xKkqJ884C\r
+       SQiAJDJK8+B6YYnmFaM40CvCvAUgVTzAJAXX/QpoMBPQYDszsMEliQgpqQZG0/1+U+LmNhS6\r
+       FsgtvXdDJ2+P47pnf19HLwoO04m4Htcy5drUyr+T/k1UL6z99fw8jxaz6FdNBQud1YEJZsfV\r
+       q8X6Dk9fLLf0dvp0j3/vWNn+/t22tOyGWGh2rdjrhQ6z/QJFXiouur3xYOsfrnrmn6++38p6\r
+       vPPaqaNfEuUOdrF9EVods/TqdCWW4oxEQy3mouJEAK5GIM0PAwAA\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: Thu, 02 Aug 2012 14:22:19 -0000\r
+\r
+On Thu, 02 Aug 2012, Mark Walters <markwalters1009@gmail.com> wrote:\r
+> In commit 5d0883e the function notmuch-search-next-thread was changed.\r
+> In particular it only goes to the next message if there is a next\r
+> message. This breaks notmuch-show-archive-thread-then-next. Fix this\r
+> by going to the "next" message whenever we are on a current message.\r
+> ---\r
+>\r
+>> On Sat, 21 Jul 2012, Austin Clements <amdragon@MIT.EDU> wrote:\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
+>> Hi Austin, bisecting suggests this patch (committed as 5d0883e) breaks\r
+>> notmuch-show-archive-thread-then-next and subsequently\r
+>> notmuch-show-advance-and-archive for me. When showing the last thread in\r
+>> the search results, notmuch-show-archive-thread-then-next used to exit\r
+>> to the end of the search buffer. Now it redisplays the current\r
+>> thread. When I hit SPC to cruise through mails, there's no indication\r
+>> that I've reached the end of search results, other than the same thread\r
+>> being displayed over and over.\r
+>\r
+> This might be the correct fix but I am not certain. It doesn't instantly\r
+> break for me! (It looks more similar to what happened before the parent\r
+> patch.)\r
+\r
+LGTM.  Technically this is still different from the old code, since it\r
+won't move forward once point is on the "End of search results" line.  I\r
+can't imagine anything actually depending on that (maybe something that\r
+loops until eobp?), but if we want to be paranoid, we could\r
+\r
+(if (notmuch-search-get-result)\r
+    (goto-char (notmuch-search-result-end)\r
+  (forward-line 1)))\r
+\r
+> Best wishes\r
+>\r
+> Mark\r
+>\r
+>\r
+>  emacs/notmuch.el |    2 +-\r
+>  1 files changed, 1 insertions(+), 1 deletions(-)\r
+>\r
+> diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+> index fd1836f..d2d82a9 100644\r
+> --- a/emacs/notmuch.el\r
+> +++ b/emacs/notmuch.el\r
+> @@ -293,7 +293,7 @@ For a mouse binding, return nil."\r
+>  (defun notmuch-search-next-thread ()\r
+>    "Select the next thread in the search results."\r
+>    (interactive)\r
+> -  (when (notmuch-search-get-result (notmuch-search-result-end))\r
+> +  (when (notmuch-search-get-result)\r
+>      (goto-char (notmuch-search-result-end))))\r
+>  \r
+>  (defun notmuch-search-previous-thread ()\r
+> -- \r
+> 1.7.9.1\r