From 32e102b72b7339774bd6df7a4c5a116584fc424a Mon Sep 17 00:00:00 2001 From: jao Date: Thu, 16 Sep 2021 04:40:15 +0100 Subject: notmuch nits --- notmuch.org | 68 +++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 31 deletions(-) (limited to 'notmuch.org') diff --git a/notmuch.org b/notmuch.org index 463bcac..4125893 100644 --- a/notmuch.org +++ b/notmuch.org @@ -218,7 +218,7 @@ :bind (:map notmuch-hello-mode-map (("a" . jao-notmuch-refresh-agenda) ("j" . jao-notmuch-jump-search) - ("n" . widget-forward) + ("n" . widget-button-press) ("p" . widget-backward) ("S" . consult-notmuch) ("g" . jao-notmuch-refresh-hello) @@ -333,6 +333,7 @@ (defun jao-notmuch-tree--forward (&optional prev) (interactive) (forward-line (if prev -1 1)) + (when prev (forward-char 2)) (jao-notmuch-tree-scroll-or-next)) (defun jao-notmuch-tree--backward () @@ -405,36 +406,41 @@ :follow 'org-notmuch-open :store 'org-notmuch-store-link) - (defun org-notmuch-open (id) - "Visit the notmuch message or thread with id ID." - (notmuch-show id)) - - (defun org-notmuch-store-link () - "Store a link to a notmuch mail message." - (case major-mode - ((notmuch-show-mode notmuch-tree-mode) - ;; Store link to the current message - (let* ((id (notmuch-show-get-message-id)) - (link (concat "notmuch:" id)) - (description (format "Mail: %s" - (notmuch-show-get-subject)))) - (if (derived-mode-p 'notmuch-show-mode) - (notmuch-show-archive-message) - (notmuch-tree-archive-message)) - (org-store-link-props - :type "notmuch" - :link link - :description description))) - (notmuch-search-mode - ;; Store link to the thread on the current line - (let* ((id (notmuch-search-find-thread-id)) - (link (concat "notmuch:" id)) - (description (format "Mail: %s" - (notmuch-search-find-subject)))) - (org-store-link-props - :type "notmuch" - :link link - :description description))))))) + (defun org-notmuch-open (id) + "Visit the notmuch message or thread with id ID." + (notmuch-show id)) + + (defun org-notmuch-store-link () + "Store a link to a notmuch mail message." + (case major-mode + ((notmuch-show-mode notmuch-tree-mode) + ;; Store link to the current message + (let* ((id (notmuch-show-get-message-id)) + (link (concat "notmuch:" id)) + (description (format "Mail: %s" + (notmuch-show-get-subject)))) + (when (y-or-n-p "Archive message? ") + (if (derived-mode-p 'notmuch-show-mode) + (notmuch-show-archive-message) + (notmuch-tree-archive-message))) + (when (y-or-n-p "Flag message? ") + (if (derived-mode-p 'notmuch-show-mode) + (notmuch-show-add-tag '("+flagged")) + (notmuch-tree-add-tag '("+flagged")))) + (org-store-link-props + :type "notmuch" + :link link + :description description))) + (notmuch-search-mode + ;; Store link to the thread on the current line + (let* ((id (notmuch-search-find-thread-id)) + (link (concat "notmuch:" id)) + (description (format "Mail: %s" + (notmuch-search-find-subject)))) + (org-store-link-props + :type "notmuch" + :link link + :description description))))))) #+end_src * hydras #+begin_src emacs-lisp -- cgit v1.2.3