From 3bf6877c102f125b9df4c5ccc4be93917188160d Mon Sep 17 00:00:00 2001 From: jao Date: Tue, 11 Jan 2022 01:53:11 +0000 Subject: notmuch: hello section navigation --- notmuch.org | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'notmuch.org') diff --git a/notmuch.org b/notmuch.org index c2d8d32..48e648c 100644 --- a/notmuch.org +++ b/notmuch.org @@ -271,6 +271,22 @@ (let ((notmuch-hello-auto-refresh nil)) (notmuch-hello))) (jao-notmuch-hello-first)))) + (defvar jao-notmuch-hello--sec-rx "^\\([0-9]+\\|All tags:.+\\)") + + (defun jao-notmuch-hello-next-section () + (interactive) + (when (re-search-forward jao-notmuch-hello--sec-rx nil t) + (widget-forward 1))) + + (defun jao-notmuch-hello-prev-section () + (interactive) + (beginning-of-line) + (unless (looking-at-p jao-notmuch-hello--sec-rx) + (re-search-backward jao-notmuch-hello--sec-rx nil t)) + (when (re-search-backward jao-notmuch-hello--sec-rx nil t) + (end-of-line) + (widget-forward 1))) + (use-package notmuch-hello :init (setq notmuch-column-control t @@ -297,7 +313,9 @@ ("S" . consult-notmuch) ("g" . jao-notmuch-refresh-hello) ("." . jao-notmuch-hello-first) - ("SPC" . widget-button-press)))) + ("SPC" . widget-button-press) + ("[" . jao-notmuch-hello-prev-section) + ("]" . jao-notmuch-hello-next-section)))) #+end_src * show -- cgit v1.2.3