From: Lars Ingebrigtsen Date: Tue, 17 May 2022 19:00:25 +0000 (+0200) Subject: Fix bogus future history entries for `M-x grep' X-Git-Tag: emacs-29.0.90~1910^2~618 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f719250f77cf3aa7a9cdf02011375f9d1e7a3775;p=emacs.git Fix bogus future history entries for `M-x grep' * lisp/net/mailcap.el (mailcap-file-default-commands): If we have no matching MIME types, don't iterate over (nil) (bug#27236). This fixes things like: (mailcap-file-default-commands '("grep --color=auto -nH --null '' ")) => ("/usr/bin/emacs -nw") --- diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el index b65f7c25b83..8ba7f1bec3d 100644 --- a/lisp/net/mailcap.el +++ b/lisp/net/mailcap.el @@ -1098,11 +1098,12 @@ For instance, `image/png' will result in `png'." (mailcap-parse-mimetypes) (let* ((all-mime-type ;; All unique MIME types from file extensions - (delete-dups - (mapcar (lambda (file) - (mailcap-extension-to-mime - (file-name-extension file t))) - files))) + (delq nil + (delete-dups + (mapcar (lambda (file) + (mailcap-extension-to-mime + (file-name-extension file t))) + files)))) (all-mime-info ;; All MIME info lists (delete-dups