diff options
author | jao <jao@gnu.org> | 2022-08-06 20:17:37 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-08-06 20:18:05 +0100 |
commit | 983e7375af65594411c842503e1a8e46086df50b (patch) | |
tree | b6e28cd5687278aea746bdeeae6dfc96e8d87c18 | |
parent | b889be5a91b968d8364152e6691d5b08757fefe9 (diff) | |
download | elibs-983e7375af65594411c842503e1a8e46086df50b.tar.gz elibs-983e7375af65594411c842503e1a8e46086df50b.tar.bz2 |
gnus: simpler open email function
-rw-r--r-- | attic/misc.el | 7 | ||||
-rw-r--r-- | custom/jao-custom-gnus.el | 14 |
2 files changed, 11 insertions, 10 deletions
diff --git a/attic/misc.el b/attic/misc.el index 9c3488f..a26f130 100644 --- a/attic/misc.el +++ b/attic/misc.el @@ -205,6 +205,13 @@ (add-hook 'gnus-part-display-hook 'jao-gnus-remove-anchors) +;;;; find message id +(defun jao-gnus-file-message-id (filename) + (with-temp-buffer + (insert-file filename) + (goto-char (point-min)) + (when (re-search-forward "^[Mm]essage-[Ii][Dd]: <?\\([^><]+\\)>?" nil t) + (match-string 1)))) ;;; mu4e (jao-load-path "mu4e") (use-package mu4e diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el index cf50ed3..732c358 100644 --- a/custom/jao-custom-gnus.el +++ b/custom/jao-custom-gnus.el @@ -1,4 +1,5 @@ -;;; gnus configuration -*- lexical-binding: t -*- +;; gnus configuration -*- lexical-binding: t -*- + ;;; Feature switching vars (defvar jao-gnus-use-local-imap nil) @@ -405,7 +406,7 @@ (g (directory-file-name (file-name-directory file))) (g (replace-regexp-in-string (file-name-as-directory maildir) "" g)) (g (replace-regexp-in-string (file-name-as-directory newsdir) "" g)) - (g (cond (nntp (concat n-server g)) + (g (cond (nntp (concat n-server ":" g)) ((file-name-directory g) (replace-regexp-in-string "^\\([^/]+\\)/" (concat m-server ":\\1/") @@ -417,16 +418,9 @@ (nntp g) (t (replace-regexp-in-string ":\\." ":" g))))) -(defun jao-gnus-file-message-id (filename) - (with-temp-buffer - (insert-file filename) - (goto-char (point-min)) - (when (re-search-forward "^[Mm]essage-[Ii][Dd]: <?\\([^><]+\\)>?" nil t) - (match-string 1)))) - (defun jao-gnus-goto-file (filename &optional _page) (let ((group (jao-gnus-file-to-group filename)) - (id (jao-gnus-file-message-id filename))) + (id (file-name-nondirectory filename))) (if (and group id) (org-gnus-follow-link group id) (message "Couldn't get relevant info for switching to Gnus.")))) |