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 C4EA3431FAF for ; Wed, 1 Aug 2012 23:51:27 -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 3ff89FoTiecm for ; Wed, 1 Aug 2012 23:51:25 -0700 (PDT) Received: from mail-gh0-f181.google.com (mail-gh0-f181.google.com [209.85.160.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id C0814431FAE for ; Wed, 1 Aug 2012 23:51:25 -0700 (PDT) Received: by ghbz13 with SMTP id z13so10091945ghb.26 for ; Wed, 01 Aug 2012 23:51:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:x-gm-message-state; bh=wj9IaBXD21l2qSjDBSvM4onXeJzOG3EpcFJpylIM9m4=; b=PVxfvuDNlTi2XEA0STA8b4Y6tExiBXq4TxVBqCGtkyD/rdCxSvl+Cgs9PAkvCJGMyJ 6cZ834B7SI34bR0Ab05IrqZvu5q2QBkwQCYoP1o8TrJZYkD6hXE7WhusyLyYGzIOknTw RLKYgt+ssh9tokZjY1YM7VhsBQDfQWXKsN8Ck2oQHgUBpY/7OxltJwbi5b5pgRy7Z/GX bChRGZ85luFb2XJ3F5uU2FhQfdqH3T6afUPNzsCCmnYK2m0rEldhSDwp2lH/fMxSGz9D FmLO6tdUhR8H24K5UBtPekmlaVLsPMcpEiPY9S3mvUAqtMZihJnfS3mwecVJZiMTtzC1 tt0g== Received: by 10.236.140.67 with SMTP id d43mr12026684yhj.19.1343890284856; Wed, 01 Aug 2012 23:51:24 -0700 (PDT) Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3]) by mx.google.com with ESMTPS id a4sm9565811yhj.11.2012.08.01.23.51.22 (version=SSLv3 cipher=OTHER); Wed, 01 Aug 2012 23:51:24 -0700 (PDT) From: Jani Nikula To: Austin Clements , notmuch@notmuchmail.org Subject: Re: [PATCH v4 7/8] emacs: Fix navigation of multi-line search result formats In-Reply-To: <1342892232-5659-8-git-send-email-amdragon@mit.edu> 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> User-Agent: Notmuch/0.13.2+106~gb810aee (http://notmuchmail.org) Emacs/23.2.1 (x86_64-pc-linux-gnu) Date: Thu, 02 Aug 2012 08:51:19 +0200 Message-ID: <87mx2dais8.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gm-Message-State: ALoCoQlES6nznbAMo+8h8s2OvKDCHPAr9Hjo6MPNYiIHlvdYKZpk3dWD1r09ql2HlsP5aVjItZeW 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 06:51:27 -0000 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. BR, Jani. > --- > emacs/notmuch.el | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/emacs/notmuch.el b/emacs/notmuch.el > index d092528..fd1836f 100644 > --- a/emacs/notmuch.el > +++ b/emacs/notmuch.el > @@ -293,18 +293,25 @@ 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) > + (let ((beg (notmuch-search-result-beginning))) > + (when beg (goto-char beg)))) > > (defun notmuch-search-first-thread () > "Select the first thread in the search results." > -- > 1.7.10 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch