bug#65872: [PATCH] Fix interactive display of MIME parts

Sean Whitton <[email protected]> Thu, 30 Jul 2026 13:27:54 +0100
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
Davide Masserut via "Bug reports for GNU Emacs, the Swiss army knife of text editors" [11/Sep  7:24pm +02] wrote:
> This patch fixes a bug that did not allow to view attachments after
> choosing to display them within Emacs.
>
> The issue is in mm-interactively-view-part, which is used by
> gnus-article-interactively-view-part and
> notmuch-show-interactively-view-part.
>
> 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.
>
>
> I discovered this bug while using notmuch with
> notmuch-show-part-button-default-action set to
> #'notmuch-show-interactively-view-part and having tried to open a pdf
> with doc-view-mode.  This bug should also be reproducible using Gnus
> but I don't know how to do it.

The code tries to string-match etc. so I think you need to update more
things than just the line you changed.

Moreover, do the docs say that you're allowed to use symbols here?  If
we are adding a new feature, are you confident there isn't other code
which assumes a string?

-- 
Sean Whitton