From c774990d26ece1bee14d3d8ae160ade22d6c9e19 Mon Sep 17 00:00:00 2001 From: Bob Rogers Date: Sat, 18 May 2024 18:00:24 -0700 Subject: [PATCH] Don't die when checking email if an inbox doesn't exist * vm+qmail.el: + (v+q-mbox-status-internal): Bug fix: Don't die if the mail file or maildir doesn't exist. + Update to use lexical binding. + (v+q-folder-spool-file-entry): Remove unused lexical. --- vm+qmail.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vm+qmail.el b/vm+qmail.el index e7992fd..667b7d3 100644 --- a/vm+qmail.el +++ b/vm+qmail.el @@ -1,3 +1,4 @@ +; -*- lexical-binding: t; -*- ;;; Hacks for using qmail (as MTA) with VM (as MUA). ;;; ;;; Modification history: @@ -124,6 +125,9 @@ inboxes/maildirs (so be careful of . and ..!).") (cond ((and v+q-ignored-mboxes (string-match v+q-ignored-mboxes inbox)) 0) + ((not (file-exists-p inbox)) + ;; Fail gently. + 0) ((file-directory-p inbox) (v+q-maildir-incoming-message-count inbox)) (t (v+q-incoming-message-count inbox))))) @@ -168,8 +172,7 @@ inbox in the vm-spool-files list. Doesn't handle POP or IMAP drops." (while tail (let* ((entry (car tail)) (folder-name (and (consp entry) - (car entry))) - (list nil)) + (car entry)))) (if (and folder-name (eq (get-file-buffer (expand-file-name folder-name)) folder)) (setq result entry -- 2.45.2