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