summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2024-05-21 21:38:44 +0800
committerJSDurand <mmemmew@gmail.com>2024-05-21 21:38:44 +0800
commit888b80d129c4d43b63e8bbe32272b00273f4dbb5 (patch)
tree4d4d70551e3858fcfd529dda7eda3ea4d9082901
parentdef754ac4c1bb310925f1b419376c718c2cb13fa (diff)
Do not try to update mails without internet connection.
* mail.el (#'durand-internet-on): This is defined in basic.el. (durand-mail-update): Do not try to update mails without internet connection.
-rw-r--r--mail.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/mail.el b/mail.el
index 47d7858..4ecddfa 100644
--- a/mail.el
+++ b/mail.el
@@ -289,6 +289,8 @@ PROCESS is finished."
(defvar durand-mail-update-buffer "*mail*"
"Buffer to display progess of updating mails.")
+(autoload #'durand-internet-on "basic.el")
+
(defun durand-mail-update (&optional foreground-p)
"Update mails.
If FOREGROUND-P is non-nil, also display the progress in a
@@ -308,7 +310,8 @@ If FOREGROUND-P is `0', do not fetch mails, but just run
((and (numberp foreground-p)
(= foreground-p 0))
(run-hooks 'durand-mail-update-hook))
- ((not (get-process "durand-mail-update"))
+ ((and (not (get-process "durand-mail-update"))
+ (durand-internet-on))
(make-process
:name "durand-mail-update"
:command durand-mail-update-command