From 0b8f339d25300909b77b15945b309f5931253120 Mon Sep 17 00:00:00 2001 From: jao Date: Thu, 27 Jan 2022 19:04:16 +0000 Subject: clean-ups for avy/link-hint --- notmuch.org | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'notmuch.org') diff --git a/notmuch.org b/notmuch.org index a0fb99f..d433ecb 100644 --- a/notmuch.org +++ b/notmuch.org @@ -591,3 +591,25 @@ (with-eval-after-load "notmuch-hello" (define-key notmuch-hello-mode-map "f" #'jao-consult-notmuch-folder)) #+end_src +* link hint + #+begin_src emacs-lisp + (with-eval-after-load "link-hint" + (defun jao-link-hint--notmuch-next-part (&optional bound) + (when-let (p (next-single-property-change (point) :notmuch-part nil bound)) + (and (< p (or bound (point-max))) p))) + + (defun jao-link-hint--notmuch-part-p () + (and (get-text-property (point) :notmuch-part) + (when-let (b (button-at (point))) (button-label b)))) + + (link-hint-define-type 'notmuch-part + :next #'jao-link-hint--notmuch-next-part + :at-point-p #'jao-link-hint--notmuch-part-p + :vars '(notmuch-show-mode) + :open #'push-button + :open-message "Toggled" + :open-multiple t) + + (push 'link-hint-notmuch-part link-hint-types)) + + #+end_src -- cgit v1.2.3