emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mailcap.el: Does mailcap support some default/catch-all entry?


From: Tassilo Horn
Subject: mailcap.el: Does mailcap support some default/catch-all entry?
Date: Sun, 16 Jan 2022 10:08:44 +0100
User-agent: mu4e 1.7.5; emacs 29.0.50

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]