unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Damien Cassou <damien@cassou.me>
To: notmuch@notmuchmail.org
Cc: Damien Cassou <damien@cassou.me>
Subject: [PATCH v2] notmuch-show-imenu-prev-index-position-function: Don't recenter
Date: Tue, 17 Dec 2024 20:29:19 +0100	[thread overview]
Message-ID: <20241217192919.889035-1-damien@cassou.me> (raw)

* emacs/notmuch-show.el (notmuch-show-imenu-prev-index-position-function):

---

This is a completely new and much simpler implementation. Idea is from
Pengji Zhang <me@pengjiz.com>.

Message-ID: <87ikria5ze.fsf@pengjiz.com>
---
 emacs/notmuch-show.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 14e3c698..921c0ef1 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -2686,7 +2686,9 @@ (defun notmuch-show-imenu-prev-index-position-function ()
 `imenu-prev-index-position-function'."
   (if (bobp)
       nil
-    (notmuch-show-previous-message)
+    (if (eobp)
+	(notmuch-show-move-to-message-top)
+      (notmuch-show-goto-message-previous))
     t))
 
 (defun notmuch-show-imenu-extract-index-name-function ()
-- 
2.47.0

                 reply	other threads:[~2024-12-17 19:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20241217192919.889035-1-damien@cassou.me \
    --to=damien@cassou.me \
    --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).