summaryrefslogtreecommitdiffhomepage
path: root/notmuch.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-01-23 04:30:42 +0000
committerjao <jao@gnu.org>2022-01-23 04:30:42 +0000
commit63aac73bd914f70e32d392c493ba8b87179ae92e (patch)
treec6b221b0867a824075a83638324f7706c96e7cc0 /notmuch.org
parentc2c3423ae00dc2425cfb9d19b6249a2b0cf33df5 (diff)
downloadelibs-63aac73bd914f70e32d392c493ba8b87179ae92e.tar.gz
elibs-63aac73bd914f70e32d392c493ba8b87179ae92e.tar.bz2
whitespace
Diffstat (limited to 'notmuch.org')
-rw-r--r--notmuch.org88
1 files changed, 41 insertions, 47 deletions
diff --git a/notmuch.org b/notmuch.org
index 07bc472..7739d2e 100644
--- a/notmuch.org
+++ b/notmuch.org
@@ -385,7 +385,6 @@
("TAB" . jao-notmuch-show-next-button)
([backtab] . jao-notmuch-show-previous-button)
("RET" . jao-notmuch-show-ret))))
-
#+end_src
* search
#+begin_src emacs-lisp
@@ -493,53 +492,48 @@
* org mode
Stolen and adapted from [[https://gist.github.com/fedxa/fac592424473f1b70ea489cc64e08911][Fedor Bezrukov]].
#+begin_src emacs-lisp
+ (defvar jao-org-notmuch-last-subject nil)
+ (defun jao-org-notmuch-last-subject () jao-org-notmuch-last-subject)
+
+ (defun jao-notmuch--add-tags (tags)
+ (if (derived-mode-p 'notmuch-show-mode)
+ (notmuch-show-add-tag tags)
+ (notmuch-tree-add-tag tags)))
+
+ (defun org-notmuch-store-link ()
+ "Store a link to a notmuch mail message."
+ (cl-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))
+ (subj (notmuch-show-get-subject))
+ (description (format "Mail: %s" subj)))
+ (setq jao-org-notmuch-last-subject subj)
+ (when (y-or-n-p "Archive message? ")
+ (jao-notmuch--add-tags '("+trove")))
+ (when (y-or-n-p "Flag message as todo? ")
+ (jao-notmuch--add-tags '("+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))
+ (subj (notmuch-search-find-subject))
+ (description (format "Mail: %s" subj)))
+ (setq jao-org-notmuch-last-subject subj)
+ (org-store-link-props
+ :type "notmuch"
+ :link link
+ :description description)))))
+
(with-eval-after-load "org"
- (with-eval-after-load "notmuch"
- (org-link-set-parameters "notmuch"
- :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))
-
- (defvar jao-org-notmuch-last-subject nil)
- (defun jao-org-notmuch-last-subject () jao-org-notmuch-last-subject)
-
- (defun jao-notmuch--add-tags (tags)
- (if (derived-mode-p 'notmuch-show-mode)
- (notmuch-show-add-tag tags)
- (notmuch-tree-add-tag tags)))
-
- (defun org-notmuch-store-link ()
- "Store a link to a notmuch mail message."
- (cl-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))
- (subj (notmuch-show-get-subject))
- (description (format "Mail: %s" subj)))
- (setq jao-org-notmuch-last-subject subj)
- (when (y-or-n-p "Archive message? ")
- (jao-notmuch--add-tags '("+trove")))
- (when (y-or-n-p "Flag message as todo? ")
- (jao-notmuch--add-tags '("+todo")))
- (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))
- (subj (notmuch-search-find-subject))
- (description (format "Mail: %s" subj)))
- (setq jao-org-notmuch-last-subject subj)
- (org-store-link-props
- :type "notmuch"
- :link link
- :description description)))))))
+ (org-link-set-parameters "notmuch"
+ :follow 'notmuch-show
+ :store 'org-notmuch-store-link))
#+end_src
* arXiv
#+begin_src emacs-lisp