all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* mailcap MIME type handlers
@ 2018-09-23  2:52 Ben Bacarisse
  2018-09-23  6:08 ` Teemu Likonen
       [not found] ` <mailman.1164.1537683367.1284.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Ben Bacarisse @ 2018-09-23  2:52 UTC (permalink / raw)
  To: help-gnu-emacs

Short version:

How can I get Emacs (specifically mailcap.el) to prioritise my system's
or my personal mailcap settings?

Gnus, for example, opens PDF files in doc-view-mode rather than using
the program specified in /etc/mailcap or ~/.mailcap.

In more detail...

From an quick examination of mailcap.el it seems that an initial set of
mailcap data, given an explicit list assigned to mailcap-mime-data, is
augmented by reading the system's mailcap files along with the user's
mailcap.  However, the initial data do not simply provide a default
back-stop because many of them use Emacs modes that are, for most
people, to be preferred.  This is achieved by sorting the list of
possible matches with a predicate that favours Lisp symbols over strings
(mailcap-viewer-lessp).  Thus '(viewer doc-view-mode) will win over
'(viewer "/usr/bin/mupdf %s") or, indeed, over any setting from the
parsed files.

I have a crude solution.  If, after mailcap is loaded, I manually
execute

  (setq mailcap-mime-data nil)
  (mailcap-parse-mailcaps nil t)

only the parsed entries will be seen as the initial value of
mailcap-mime-data is lost.  But this is not a good solution not least
because I may want some of these "built-in" handlers -- I haven't
checked them all.

What is the proper way to deal with this?

If there isn't a neat solution, maybe I can hook into the mailcap system
to get the behaviour I want.  What's the best way to do that?  Do I need
to resort to advice-add?

-- 
Ben.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-23 14:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-23  2:52 mailcap MIME type handlers Ben Bacarisse
2018-09-23  6:08 ` Teemu Likonen
     [not found] ` <mailman.1164.1537683367.1284.help-gnu-emacs@gnu.org>
2018-09-23 14:38   ` Ben Bacarisse

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.