diff options
author | JSDurand <mmemmew@gmail.com> | 2024-07-31 16:38:14 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2024-07-31 16:38:14 +0800 |
commit | eac0b7a1dae4d3af314321bba5eed33e9a408bcb (patch) | |
tree | 05b6cc7d9323b0e33190bc06b00110254171561a | |
parent | ffc1490530460759689b0355679743544d338a9e (diff) |
mail: Only update mails automatically when GNUS is on.
* mail.el (durand-mail-update): Only update mails automatically when
GNUS is on. Sometimes I want to carry the computer to some place
without internet, in which case I do not really want to update
mails. With this change, I can simply turn off GNUS to stop
automatically updating mails, without cancelling the timer, which is
quite convenient in my opinion.
-rw-r--r-- | mail.el | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -307,11 +307,16 @@ If FOREGROUND-P is `0', do not fetch mails, but just run 0) ((null arg)))))) (let ((process-found (get-process "durand-mail-update")) - (internet-on (durand-internet-on))) + (internet-on (durand-internet-on)) + (gnus-on (get-buffer "*Group*"))) (cond ((and (numberp foreground-p) (= foreground-p 0)) (run-hooks 'durand-mail-update-hook)) + ((not gnus-on) + ;; Do nothing if GNUS is not turned on, and the function is + ;; asked to update in the background. + ) ((and (not process-found) internet-on) (make-process :name "durand-mail-update" |