summaryrefslogtreecommitdiffhomepage
path: root/lib/org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-03-25 17:52:35 +0000
committerjao <jao@gnu.org>2021-03-25 17:52:35 +0000
commit55704c31109c278f03d4a1e9c84770d88781d976 (patch)
tree6bee556d70fa61f761bacc4ab719ab3b4be4862f /lib/org
parentec9aa2881c1bfd3cfde296f84d9fb71490961cc0 (diff)
downloadelibs-55704c31109c278f03d4a1e9c84770d88781d976.tar.gz
elibs-55704c31109c278f03d4a1e9c84770d88781d976.tar.bz2
new message: org link (and use it consistently: notmuch, recoll, etc.)
Diffstat (limited to 'lib/org')
-rw-r--r--lib/org/jao-org-links.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/org/jao-org-links.el b/lib/org/jao-org-links.el
index 21bf27c..f8080f5 100644
--- a/lib/org/jao-org-links.el
+++ b/lib/org/jao-org-links.el
@@ -1,4 +1,5 @@
(require 'jao-org-utils)
+(require 'jao-maildir)
(require 'pdf-info)
(defvar jao-org--sink-dir "./")
@@ -77,6 +78,16 @@
(setq outline (cdr outline)))
(replace-regexp-in-string "[[:blank:]]+" " " cur-title)))
+(defun jao-org-links-open-mail (fname)
+ (let ((group (jao-maildir-file-to-group fname))
+ (id (with-temp-buffer
+ (insert-file fname)
+ (goto-char (point-min))
+ (message-mode)
+ (not-modified)
+ (message-fetch-field "Message-ID"))))
+ (when (and group id) (org-gnus-follow-link group id))))
+
;;;###autoload
(defvar jao-org-links-pdf-store-fun nil)
@@ -107,6 +118,7 @@
:follow #'jao-org-links--follow-doc
:complete #'jao-org-links--complete-doc
:store #'jao-org-links--store-pdf-link)
+ (org-link-set-parameters "message" :follow #'jao-org-links-open-mail)
(setq jao-org--sink-dir (file-name-as-directory sink-dir)))
;;;###autoload