From: Austin Clements <amdragon@MIT.EDU>
To: Mark Walters <markwalters1009@gmail.com>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH 7/7] emacs: Fix navigation of multi-line search result formats
Date: Fri, 13 Jul 2012 13:53:52 -0400 [thread overview]
Message-ID: <20120713175352.GN7332@mit.edu> (raw)
In-Reply-To: <871ukfshjd.fsf@qmul.ac.uk>
Quoth Mark Walters on Jul 13 at 6:21 pm:
> On Fri, 13 Jul 2012, Austin Clements <amdragon@MIT.EDU> 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.
> 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."
next prev parent reply other threads:[~2012-07-13 17:53 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-13 0:45 [PATCH 0/7] emacs: JSON-based search cleanups Austin Clements
2012-07-13 0:45 ` [PATCH 1/7] emacs: Record thread search result object in a text property Austin Clements
2012-07-13 0:45 ` [PATCH 2/7] emacs: Use text properties instead of overlays for tag coloring Austin Clements
2012-07-13 17:59 ` Mark Walters
2012-07-13 18:43 ` Austin Clements
2012-07-13 0:45 ` [PATCH 3/7] emacs: Update tags by rewriting the search result line in place Austin Clements
2012-07-13 17:57 ` Mark Walters
2012-07-13 18:33 ` Austin Clements
2012-07-13 0:45 ` [PATCH 4/7] emacs: Use result text properties for search result iteration Austin Clements
2012-07-13 0:45 ` [PATCH 5/7] emacs: Replace other search text properties with result property Austin Clements
2012-07-13 0:45 ` [PATCH 6/7] emacs: Allow custom tags formatting Austin Clements
2012-07-13 0:45 ` [PATCH 7/7] emacs: Fix navigation of multi-line search result formats Austin Clements
2012-07-13 17:21 ` Mark Walters
2012-07-13 17:53 ` Austin Clements [this message]
2012-07-13 18:02 ` Mark Walters
2012-07-13 18:12 ` [PATCH 0/7] emacs: JSON-based search cleanups Mark Walters
2012-07-14 3:28 ` Austin Clements
2012-07-14 3:43 ` [PATCH v2 " Austin Clements
2012-07-14 3:43 ` [PATCH v2 1/7] emacs: Record thread search result object in a text property Austin Clements
2012-07-14 3:43 ` [PATCH v2 2/7] emacs: Use text properties instead of overlays for tag coloring Austin Clements
2012-07-14 3:43 ` [PATCH v2 3/7] emacs: Update tags by rewriting the search result line in place Austin Clements
2012-07-14 3:43 ` [PATCH v2 4/7] emacs: Use result text properties for search result iteration Austin Clements
2012-07-14 19:31 ` Jameson Graef Rollins
2012-07-14 19:35 ` Jameson Graef Rollins
2012-07-14 19:50 ` Austin Clements
2012-07-14 20:01 ` Austin Clements
2012-07-14 21:13 ` Jameson Graef Rollins
2012-07-14 21:51 ` Austin Clements
2012-07-14 23:02 ` Jameson Graef Rollins
2012-07-14 21:15 ` Mark Walters
2012-07-14 3:43 ` [PATCH v2 5/7] emacs: Replace other search text properties with result property Austin Clements
2012-07-14 3:43 ` [PATCH v2 6/7] emacs: Allow custom tags formatting Austin Clements
2012-07-14 3:43 ` [PATCH v2 7/7] emacs: Fix navigation of multi-line search result formats Austin Clements
2012-07-14 19:06 ` [PATCH v2 0/7] emacs: JSON-based search cleanups Jameson Graef Rollins
2012-07-14 23:02 ` [PATCH v3 0/8] " Austin Clements
2012-07-14 23:02 ` [PATCH v3 1/8] emacs: Record thread search result object in a text property Austin Clements
2012-07-14 23:02 ` [PATCH v3 2/8] emacs: Use text properties instead of overlays for tag coloring Austin Clements
2012-07-14 23:02 ` [PATCH v3 3/8] emacs: Update tags by rewriting the search result line in place Austin Clements
2012-07-14 23:02 ` [PATCH v3 4/8] emacs: Use result text properties for search result iteration Austin Clements
2012-07-14 23:02 ` [PATCH v3 5/8] emacs: Replace other search text properties with result property Austin Clements
2012-07-14 23:02 ` [PATCH v3 6/8] emacs: Allow custom tags formatting Austin Clements
2012-07-14 23:02 ` [PATCH v3 7/8] emacs: Fix navigation of multi-line search result formats Austin Clements
2012-07-14 23:02 ` [PATCH v3 8/8] News for search cleanups Austin Clements
2012-07-15 8:34 ` [PATCH v3 0/8] emacs: JSON-based " Mark Walters
2012-07-15 21:14 ` Jameson Graef Rollins
2012-07-15 16:27 ` Mark Walters
2012-07-15 18:00 ` Austin Clements
2012-07-15 18:14 ` Mark Walters
2012-07-21 17:55 ` [PATCH v4] " Austin Clements
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120713175352.GN7332@mit.edu \
--to=amdragon@mit.edu \
--cc=markwalters1009@gmail.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).