From 9f45d1b4c06bea2ffca7f7575f7600e8530b3814 Mon Sep 17 00:00:00 2001 From: Davide Masserut Date: Mon, 11 Sep 2023 16:49:21 +0200 Subject: [PATCH] Fix interactive display of MIME parts mailcap-mime-info may return a list of functions or strings containing external commands. This list is passed to completing-read, which always returns a string. Before this change, when the method is a string, mm-display-external would have attempted to execute it through a shell even when the method refers to an Elisp function. * lisp/gnus/mm-decode.el (mm-interactively-view-part): When method contains a valid symbol, extract it using intern. --- lisp/gnus/mm-decode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index b9beedf6c5c..1f91491afa1 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -1501,7 +1501,7 @@ mm-interactively-view-part (when (string= method "") (error "No method given")) (if (string-match "^[^% \t]+$" method) - (setq method (concat method " %s"))) + (setq method (or (intern-soft method) (concat method " %s")))) (mm-display-external handle method))) (defun mm-preferred-alternative (handles &optional preferred) -- 2.42.0