all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Tomas Nordin <tomasn@posteo.net>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 36771@debbugs.gnu.org
Subject: bug#36771: 27.0.50; mailcap documentation and effect missmatch
Date: Thu, 3 Oct 2019 01:38:53 +0200	[thread overview]
Message-ID: <CADwFkm=gRG-DP2Hp_WvPJ+G9t2qjMUQzzDY5ugpGJt_wmfq=8Q@mail.gmail.com> (raw)
In-Reply-To: <87ftmxnqw7.fsf@posteo.net>

Tomas Nordin <tomasn@posteo.net> writes:

> emacs -Q
>
> In the scratch buffer, eval each of the following:
>
> (require 'mailcap)
> (mailcap-mime-info "text/html") ;; -> "view %s"
> mailcap-prefer-mailcap-viewers ;; -> t
> (setq mailcap-prefer-mailcap-viewers t) ;; -> nil
> (mailcap-mime-info "text/html") ;; -> "/usr/bin/firefox-esr %s"
>
> I expect the result of mailcap-mime-info to be "/usr/bin/firefox-esr %s"
> when mailcap-prefer-mailcap-viewers is t because the doc of that
> variable says
>
>    If non-nil, prefer viewers specified in ~/.mailcap.
>    If nil, the most specific viewer will be chosen, even if there is
>    a general override in ~/.mailcap.  For instance, if /etc/mailcap
>    has an entry for "image/gif", that one will be chosen even if
>    you have an entry for "image/*" in your ~/.mailcap file.
>
> and
>
> $ cat ~/.mailcap | grep '^text/html'
> text/html; /usr/bin/firefox-esr %s; description=HTML Text; test=test -n "$DISPLAY";  nametemplate=%s.html
>
> What do you think?

Indeed, this seems to me like it's contradicting the doc string.

> If you agree this is a bug, I could provide that a bisect session gave
> me that it started to behave this way by commit
> 7e47d44da4b54c518c5e09b4f3d58dafdd43033d

Lars, that commit is yours.  What do you think?

I tried digging into this code, but found mailcap.el too confusing overall...

> In addition I am confused why mailcap-mime-info produces "view %s" in
> any case because
>
> $ cat /etc/mailcap | grep '^text/html'
> text/html; /usr/bin/sensible-browser %s; description=HTML Text; nametemplate=%s.html
> text/html; /usr/bin/firefox-esr %s; description=HTML Text; test=test -n "$DISPLAY";  nametemplate=%s.html
> text/html; gnome-builder %s; test=test -n "$DISPLAY"
> text/html; /usr/bin/w3m -T text/html %s; needsterminal; description=HTML Text; nametemplate=%s.html
> text/html; /usr/bin/w3m -I %{charset} -dump -T text/html %s; copiousoutput; description=HTML Text; nametemplate=%s.html
>
> I would naively think that the above would result in sensible-browser maybe.

Agreed.  Here I would have expected to get the more specific entry, but
I get the least specific entry.  On my system "view" in /etc/mailcap is:

text/*; view %s; edit=vim %s; compose=vim %s; test=test -x
/usr/bin/vim; needsterminal
text/*; view %s; edit=vi %s; compose=vi %s; needsterminal

Best regards,
Stefan Kangas





  reply	other threads:[~2019-10-02 23:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23  7:36 bug#36771: 27.0.50; mailcap documentation and effect missmatch Tomas Nordin
2019-10-02 23:38 ` Stefan Kangas [this message]
2019-10-03 15:02   ` Lars Ingebrigtsen
2019-10-05 11:09     ` Tomas Nordin
2019-10-07  2:35   ` Lars Ingebrigtsen
2019-10-07  3:01     ` Lars Ingebrigtsen
2019-10-13  9:42       ` Tomas Nordin
2019-10-13 17:18         ` Lars Ingebrigtsen
2019-10-13 18:16           ` Tomas Nordin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkm=gRG-DP2Hp_WvPJ+G9t2qjMUQzzDY5ugpGJt_wmfq=8Q@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=36771@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=tomasn@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.