From e3b43f6cd8a12926206c9a72baf156e5b5c90cef Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 14 Jan 2022 09:25:32 +0100 Subject: [PATCH] Fix mailcap setup when no mailcap files exist * lisp/net/mailcap.el (mailcap-parse-mailcaps): Ensure that we populate mailcap--computed-mime-data even if none of the files exist (bug#53009). --- lisp/net/mailcap.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el index bf3c8edd1e3..daa2d5a3fb3 100644 --- a/lisp/net/mailcap.el +++ b/lisp/net/mailcap.el @@ -439,9 +439,10 @@ MAILCAPS if set; otherwise (on Unix) use the path from RFC 1524, plus ("/usr/local/etc/mailcap" system))))) (when (stringp path) (setq path (mapcar #'list (split-string path path-separator t)))) - (when (seq-some (lambda (f) - (file-has-changed-p (car f) 'mail-parse-mailcaps)) - path) + (when (or (null mailcap--computed-mime-data) + (seq-some (lambda (f) + (file-has-changed-p (car f) 'mail-parse-mailcaps)) + path)) ;; Clear out all old data. (setq mailcap--computed-mime-data nil) ;; Add the Emacs-distributed defaults (which will be used as -- 2.39.2