fix(emacs): update notmuch integration
- Pin notmuch to the version that comes with Ubuntu and is installed with apt - Add org-move capture integration - Add unread message filter
This commit is contained in:
parent
e8bbbae10a
commit
653c7af2ae
2 changed files with 45 additions and 4 deletions
|
|
@ -101,6 +101,7 @@
|
|||
;; Email
|
||||
"e" '(:ignore t :which-key "Email")
|
||||
"ei" 'aa/notmuch-search-inbox
|
||||
"eu" 'aa/notmuch-search-inbox-unread
|
||||
"es" 'counsel-notmuch
|
||||
"en" 'notmuch
|
||||
"ej" 'notmuch-jump-search
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
;; licence that can be found in the LICENCE file or at
|
||||
;; https://www.practically.io/copyright/
|
||||
|
||||
(require 'cl)
|
||||
|
||||
(defvar notmuch-message-deleted-tags '("+deleted" "-inbox" "-unread"))
|
||||
|
||||
(defun spacemacs/notmuch-search-archive-thread-down ()
|
||||
|
|
@ -42,14 +44,26 @@
|
|||
(interactive)
|
||||
(notmuch-search "tag:inbox"))
|
||||
|
||||
(use-package notmuch
|
||||
:defer t
|
||||
:commands notmuch
|
||||
:config
|
||||
(defun aa/notmuch-search-inbox-unread ()
|
||||
"Search the notmuch unread messages in the inbox."
|
||||
(interactive)
|
||||
(notmuch-search "tag:inbox and tag:unread"))
|
||||
|
||||
|
||||
(quelpa
|
||||
'(notmuch :fetcher git
|
||||
:url "https://git.notmuchmail.org/git/notmuch"
|
||||
:commit "a59ef7d02cb229c2ec3569024918024003568aea"
|
||||
:files ("emacs/*.el" "emacs/*.png"))
|
||||
|
||||
(setq notmuch-saved-searches '((:name "inbox"
|
||||
:key "i"
|
||||
:query "tag:inbox"
|
||||
:sort-order newest-first)
|
||||
(:name "inbox-unread"
|
||||
:key "iu"
|
||||
:query "tag:inbox and tag:unread"
|
||||
:sort-order newest-first)
|
||||
(:name "unread"
|
||||
:key "u"
|
||||
:query "tag:unread"
|
||||
|
|
@ -80,3 +94,29 @@
|
|||
"d" 'spacemacs/notmuch-message-delete-down))
|
||||
|
||||
(use-package counsel-notmuch :defer t)
|
||||
|
||||
(defun org-notmuch-open (id)
|
||||
"Visit the notmuch message or thread with id ID."
|
||||
(notmuch-show id))
|
||||
|
||||
(defun org-notmuch-store-link ()
|
||||
"Store a link to a notmuch mail message."
|
||||
(cl-case major-mode
|
||||
('notmuch-show-mode
|
||||
;; Store link to the current message
|
||||
(let* ((id (notmuch-show-get-message-id))
|
||||
(link (concat "notmuch:" id))
|
||||
(description (format "Mail: %s" (notmuch-show-get-subject))))
|
||||
(org-store-link-props
|
||||
:type "notmuch"
|
||||
:link link
|
||||
:description description)))
|
||||
('notmuch-search-mode
|
||||
;; Store link to the thread on the current line
|
||||
(let* ((id (notmuch-search-find-thread-id))
|
||||
(link (concat "notmuch:" id))
|
||||
(description (format "Mail: %s" (notmuch-search-find-subject))))
|
||||
(org-store-link-props
|
||||
:type "notmuch"
|
||||
:link link
|
||||
:description description)))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue