]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix problem when ~/.mailcap had several entries for a MIME type
authorLars Ingebrigtsen <larsi@gnus.org>
Sat, 6 Feb 2021 10:40:00 +0000 (11:40 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 6 Feb 2021 10:40:00 +0000 (11:40 +0100)
* lisp/net/mailcap.el (mailcap-mime-info): Use all the matching
entries from ~/.mailcap, not just the first (bug#46318).

lisp/net/mailcap.el

index 455673b5e9f3362aefb274dfe24f2e0fc4b04f55..b95cd0febcdf883cf6a0f5718a0ce0619df55314 100644 (file)
@@ -842,11 +842,11 @@ If NO-DECODE is non-nil, don't decode STRING."
             ;; ~/.mailcap file, then we filter out the system entries
             ;; and see whether we have anything left.
             (when mailcap-prefer-mailcap-viewers
-              (when-let ((user-entry
-                          (seq-find (lambda (elem)
-                                      (eq (cdr (assq 'source elem)) 'user))
-                                    passed)))
-                (setq passed (list user-entry))))
+              (when-let ((user-entries
+                          (seq-filter (lambda (elem)
+                                        (eq (cdr (assq 'source elem)) 'user))
+                                      passed)))
+                (setq passed user-entries)))
             (setq viewer (car passed))))
         (when (and (stringp (cdr (assq 'viewer viewer)))
                    passed)