summaryrefslogtreecommitdiffhomepage
path: root/notmuch.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-09-16 04:40:15 +0100
committerjao <jao@gnu.org>2021-09-16 04:40:15 +0100
commit32e102b72b7339774bd6df7a4c5a116584fc424a (patch)
treee5388496ffaed7392e981eccd0f11e1c41c61a0b /notmuch.org
parent2ac043d0a8e4511df716f89f0052d854c58e8aa6 (diff)
downloadelibs-32e102b72b7339774bd6df7a4c5a116584fc424a.tar.gz
elibs-32e102b72b7339774bd6df7a4c5a116584fc424a.tar.bz2
notmuch nits
Diffstat (limited to 'notmuch.org')
-rw-r--r--notmuch.org68
1 files changed, 37 insertions, 31 deletions
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