Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (require 'notmuch)
- (setq notmuch-command "~/remote-notmuch.sh")
- (setq notmuch-fcc-dirs nil)
- (add-hook 'gnus-group-mode-hook 'lld-notmuch-shortcut)
- (require 'org-gnus)
- (defun lld-notmuch-shortcut ()
- (define-key gnus-group-mode-map "GG" 'notmuch-search)
- )
- (defun lld-notmuch-file-to-group (file)
- "Calculate the Gnus group name from the given file name."
- (let ((group (file-name-directory (directory-file-name (file-name-directory file)))))
- (setq group (replace-regexp-in-string ".*/Maildir/" "nnimap+apollo.corbe.net:" group))
- (setq group (replace-regexp-in-string "/$" "" group))
- (if (string-match ":$" group)
- (concat group "INBOX")
- (replace-regexp-in-string ":\\." ":" group))))
- (defun lld-notmuch-goto-message-in-gnus ()
- "Open a summary buffer containing the current notmuch
- article."
- (interactive)
- (let ((group (lld-notmuch-file-to-group (notmuch-show-get-filename)))
- (message-id (replace-regexp-in-string
- "^id:" "" (notmuch-show-get-message-id))))
- (setq message-id (replace-regexp-in-string "\"" "" message-id))
- (if (and group message-id)
- (progn
- (switch-to-buffer "*Group*")
- (switch-to-buffer "*Group*")
- (org-gnus-follow-link group message-id))
- (message "Couldn't get relevant infos for switching to Gnus."))))
- (define-key notmuch-show-mode-map (kbd "C-c C-c") 'lld-notmuch-goto-message-in-gnus)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement