* mailcap.el: Does mailcap support some default/catch-all entry?
@ 2022-01-16 9:08 Tassilo Horn
0 siblings, 0 replies; only message in thread
From: Tassilo Horn @ 2022-01-16 9:08 UTC (permalink / raw)
To: emacs-devel
Hi all,
I've written some mailcap tests for viewer selection yesterday and
stumbled upon some code and behavior I don't understand. Basically the
question is if mailcaps can have some default/catch-all entry which is
chosen if no other entry matches.
For example, assume your mailcaps contain neither entries for video/mpeg
nor video/* and one calls
(mailcap-mime-info "video/mpeg") ;=> nil
But in `mailcap-mime-info' there's the cond-case
(cond
((and (null viewer) (not (equal major "default")) request)
(mailcap-mime-info "default" request no-decode))
at the end. So if I call it with a non-nil `request' argument, e.g.,
(mailcap-mime-info "video/mpeg" "")
it'll recurse once with
(mailcap-mime-info "default" "")
which somehow indicates that one could have a mailcap entry like:
default; xdg-open %s
However, when I put that (or default/*) into my mailcap, it won't match,
because the local variable `minor' is nil and therefore the
(mailcap-possible-viewers major-info minor)
which explicitly checks that minor is non-nil.
So that call with "default" seems to never be able to return a viewer.
But in the mailcap man-page I don't find something about being able to
have a default/catch-all entry anyway. (Initially, I assumed that */*
should work but there is no wildcard support for major AFAICT.)
Bye,
Tassilo
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-16 9:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-16 9:08 mailcap.el: Does mailcap support some default/catch-all entry? Tassilo Horn
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).