diff options
Diffstat (limited to 'init.org')
-rw-r--r-- | init.org | 30 |
1 files changed, 2 insertions, 28 deletions
@@ -1889,38 +1889,12 @@ :bind (:map notmuch-show-mode-map ("C-c C-c" . jao-notmuch-goto-message-in-gnus)))) #+END_SRC -***** Go notmuch -> gnus (and use notmuch as default search) +***** notmuch -> gnus #+begin_src emacs-lisp - (defun jao-notmuch-file-to-group (file) - "Calculate the Gnus group name from the given file name. - - Example: - - IN: /home/jao/var/mail/jao/foo/cur/1259184569.M4818P3384.localhost,W=6921:2,S - OUT: nnimap:jao/foo - - IN: /home/jao/var/mail/gmane/foo/bar/100 - OUT: nntp+localhost:gmane.foo.bar - - IN: /home/jao/var/mail/bigml/cur/1259176906.M17483P24679.localhost,W=2488:2,S - OUT:nnimap:bigml/inbox" - (let* ((g (directory-file-name (file-name-directory file))) - (g (replace-regexp-in-string "/home/jao/var/mail/" "" g)) - (nntp (string-match-p "^\\(gmane\\|gwene\\)/" g)) - (g (if nntp - (concat "nntp+localhost:" g) - (replace-regexp-in-string "^\\([^/]+\\)/" "nnimap:\\1/" - (file-name-directory g) t))) - (g (if nntp (replace-regexp-in-string "/" "." g) g)) - (g (replace-regexp-in-string "[/.]$" "" g))) - (cond ((string-match ":$" g) (concat g "inbox")) - (nntp g) - (t (replace-regexp-in-string ":\\." ":" g))))) - (defun jao-notmuch-goto-message-in-gnus () "Open a summary buffer containing the current notmuch article." (interactive) - (let ((group (jao-notmuch-file-to-group (notmuch-show-get-filename))) + (let ((group (jao-maildir-file-to-group (notmuch-show-get-filename))) (message-id (replace-regexp-in-string "^id:" "" (notmuch-show-get-message-id)))) |