diff options
| author | JSDurand <mmemmew@gmail.com> | 2026-06-04 00:29:59 +0800 |
|---|---|---|
| committer | JSDurand <mmemmew@gmail.com> | 2026-06-04 00:29:59 +0800 |
| commit | c5cb66fd5ac9b24c3c462876a463aa9e78bddbd2 (patch) | |
| tree | 2259a6cea55c8a7872825202ccaf9fdb8be72bf4 /mail.el | |
| parent | 101d1dea204d53b8043376d0df87f360258dddfe (diff) | |
* mail.el (notmuch-new, durand-mail-update-hook): I now call `notmuch
new` inside the update-hook to keep notmuch in synchronization.
(durand-mail-update): I used to message about the internet not being
connected when trying to update. Now this is disblaed if the
updating happens in background.
Diffstat (limited to 'mail.el')
| -rw-r--r-- | mail.el | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -268,6 +268,14 @@ mails." (defvar durand-mail-update-hook nil "The hook run after the process that updates mails is finished.") +;; Update notmuch index + +(defun notmuch-new () + "Run notmuch new." + (call-process "notmuch" nil nil nil "new")) + +(add-hook 'durand-mail-update-hook #'notmuch-new) + (defun durand-mail-update-sentinel (process status) "Handle STATUS changes of the PROCESS for updating mails. This funciton runs the hook `durand-mail-update-hook' after the @@ -331,8 +339,11 @@ If FOREGROUND-P is `0', do not fetch mails, but just run durand-mail-update-buffer))) (buffer-disable-undo buffer) buffer))))) - ((not (or process-found internet-on)) - (message "MAIL: There is no internet connection."))))) + ;; I do not want to be notified of this when it runs in the + ;; background. + ((and foreground-p (not (or process-found internet-on))) + (message "MAIL: There is no internet connection.") + )))) (defvar durand-mail-update-timer nil "A timer to automatically update mail in the background.") |
