From 888b80d129c4d43b63e8bbe32272b00273f4dbb5 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Tue, 21 May 2024 21:38:44 +0800 Subject: 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. --- mail.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-18-g5258