diff options
Diffstat (limited to 'lib/org')
-rw-r--r-- | lib/org/jao-org-links.el | 12 |
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 |