diff options
Diffstat (limited to 'lisp/acdw-mail.el')
-rw-r--r-- | lisp/acdw-mail.el | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/lisp/acdw-mail.el b/lisp/acdw-mail.el index 8b0ab25..ae78fa0 100644 --- a/lisp/acdw-mail.el +++ b/lisp/acdw-mail.el | |||
@@ -74,6 +74,7 @@ for a free-form search. With any other PREFIX argument, open | |||
74 | (mapcar (lambda (elt) | 74 | (mapcar (lambda (elt) |
75 | (plist-get elt :name)) | 75 | (plist-get elt :name)) |
76 | notmuch-saved-searches)) | 76 | notmuch-saved-searches)) |
77 | notmuch-saved-searches | ||
77 | :key (lambda (elt) (plist-get elt :name)) | 78 | :key (lambda (elt) (plist-get elt :name)) |
78 | :test #'equal) | 79 | :test #'equal) |
79 | :query))) | 80 | :query))) |
@@ -127,6 +128,22 @@ the saved search as well." | |||
127 | (equal (plist-get a :name) | 128 | (equal (plist-get a :name) |
128 | (plist-get b :name)))))) | 129 | (plist-get b :name)))))) |
129 | 130 | ||
131 | (defun notmuch-async-poll () | ||
132 | "Run `notmuch-poll' in an async process." | ||
133 | (interactive) | ||
134 | (if (require 'async nil t) | ||
135 | (progn | ||
136 | (message "Polling mail async...") | ||
137 | (async-start | ||
138 | (lambda () | ||
139 | (push "~/usr/share/emacs/site-lisp/" load-path) | ||
140 | (require 'notmuch-lib) | ||
141 | (notmuch-poll)) | ||
142 | (lambda (result) | ||
143 | (message "%s" result)))) | ||
144 | (user-error "Feature `async' not found!"))) | ||
145 | |||
146 | |||
130 | ;;; Packages | 147 | ;;; Packages |
131 | 148 | ||
132 | (use-package bbdb | 149 | (use-package bbdb |
@@ -174,7 +191,9 @@ the saved search as well." | |||
174 | mail-specify-envelope-from t | 191 | mail-specify-envelope-from t |
175 | message-sendmail-envelope-from 'header | 192 | message-sendmail-envelope-from 'header |
176 | message-envelope-from 'header | 193 | message-envelope-from 'header |
177 | notmuch-saved-searches nil) | 194 | notmuch-saved-searches nil |
195 | notmuch-poll-script "~/usr/scripts/syncmail" ; XXX: Deprecated option | ||
196 | ) | ||
178 | ;; Key bindings | 197 | ;; Key bindings |
179 | (keymap-set notmuch-search-mode-map "!" #'+notmuch-search-mark-spam) | 198 | (keymap-set notmuch-search-mode-map "!" #'+notmuch-search-mark-spam) |
180 | (keymap-set notmuch-search-mode-map "RET" #'notmuch-search-show-thread) | 199 | (keymap-set notmuch-search-mode-map "RET" #'notmuch-search-show-thread) |
@@ -205,6 +224,9 @@ the saved search as well." | |||
205 | (add-hook 'notmuch-message-mode-hook #'visual-fill-column-mode) | 224 | (add-hook 'notmuch-message-mode-hook #'visual-fill-column-mode) |
206 | (add-hook 'notmuch-show-mode-hook #'visual-fill-column-mode) | 225 | (add-hook 'notmuch-show-mode-hook #'visual-fill-column-mode) |
207 | 226 | ||
227 | (define-advice notmuch-bury-or-kill-this-buffer (:after (&rest _) poll-async) | ||
228 | (notmuch-async-poll)) | ||
229 | |||
208 | (define-advice notmuch-address-selection-function | 230 | (define-advice notmuch-address-selection-function |
209 | (:override (prompt collection _) no-initial-input) | 231 | (:override (prompt collection _) no-initial-input) |
210 | "Call `completing-read' with `notmuch-address-history'. | 232 | "Call `completing-read' with `notmuch-address-history'. |