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 AF539431FD4 for ; Fri, 13 Jul 2012 11:02:56 -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 MBlfO0ksw5Ji for ; Fri, 13 Jul 2012 11:02:55 -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 ACE9B431FAE for ; Fri, 13 Jul 2012 11:02:55 -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 1SpkCb-00051B-NZ; Fri, 13 Jul 2012 19:02:54 +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 1SpkCb-0005tt-Bk; Fri, 13 Jul 2012 19:02:53 +0100 From: Mark Walters To: Austin Clements Subject: Re: [PATCH 7/7] emacs: Fix navigation of multi-line search result formats In-Reply-To: <20120713175352.GN7332@mit.edu> References: <1342140319-19859-1-git-send-email-amdragon@mit.edu> <1342140319-19859-8-git-send-email-amdragon@mit.edu> <871ukfshjd.fsf@qmul.ac.uk> <20120713175352.GN7332@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 19:02:51 +0100 Message-ID: <874npb8rp0.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: f2f33e29ec7df29f951c8c4b55a314b2 (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 Cc: notmuch@notmuchmail.org 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 18:02:56 -0000 On Fri, 13 Jul 2012, Austin Clements wrote: > Quoth Mark Walters on Jul 13 at 6:21 pm: >> 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. > > Oh, yes, that's true. I suppose that choice was deliberate in the > sense that I wrote notmuch-search-previous-thread the way I thought it > should work without thinking very hard about how it originally worked. > > I could rework it to keep the original behavior, or keep it this way > and document it in the commit message (and maybe NEWS). Personally I > would prefer to keep it this way and update show's p binding to behave > similarly since I've always found show's p to be confusing. I would be very happy with keeping the new way and updating show: I also find the p behaviour in show confusing/annoying. Best wishes Mark > >> 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."