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 AD305431FB6 for ; Fri, 13 Jul 2012 10:22:09 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.098 X-Spam-Level: X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 XDY44YB2jNyv for ; Fri, 13 Jul 2012 10:22:09 -0700 (PDT) Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 1488F431FAE for ; Fri, 13 Jul 2012 10:22:09 -0700 (PDT) Received: from smtp.qmul.ac.uk ([138.37.6.40]) by mail2.qmul.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1SpjZ2-0003WR-Nd; Fri, 13 Jul 2012 18:22:04 +0100 Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1SpjZ2-0003hL-FL; Fri, 13 Jul 2012 18:22:00 +0100 From: Mark Walters To: Austin Clements , notmuch@notmuchmail.org Subject: Re: [PATCH 7/7] emacs: Fix navigation of multi-line search result formats In-Reply-To: <1342140319-19859-8-git-send-email-amdragon@mit.edu> References: <1342140319-19859-1-git-send-email-amdragon@mit.edu> <1342140319-19859-8-git-send-email-amdragon@mit.edu> User-Agent: Notmuch/0.13.2+63~g1397edd (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Fri, 13 Jul 2012 18:21:58 +0100 Message-ID: <871ukfshjd.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender-Host-Address: 94.192.233.223 X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: 02f16b50efaf1167b85a10dfcd0ddbfe (of first 20000 bytes) X-SpamAssassin-Score: -1.8 X-SpamAssassin-SpamBar: - X-SpamAssassin-Report: The QM spam filters have analysed this message to determine if it is spam. We require at least 5.0 points to mark a message as spam. This message scored -1.8 points. Summary of the scoring: * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, * medium trust * [138.37.6.40 listed in list.dnswl.org] * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (markwalters1009[at]gmail.com) * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay * domain * 0.5 AWL AWL: From: address is in the auto white-list X-QM-Scan-Virus: ClamAV says the message is clean 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: Fri, 13 Jul 2012 17:22:09 -0000 On Fri, 13 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 seems to subtly change the behaviour in the normal case of a single line result. If point is not at the start of a search result then notmuch-search-previous-thread moves to the start of the current thread rather than the previous thread. Is that deliberate? As far as I can see show uses p to move to the start of the previous message so this behaviour is different from there as well. I think your choice may be the nicest one (and actually even more so in show) but thought I would mention it anyway. Best wishes Mark > --- > emacs/notmuch.el | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/emacs/notmuch.el b/emacs/notmuch.el > index f32cfb0..2ece97d 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 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch