Variable: mailcap-user-mime-data
mailcap-user-mime-data is a customizable variable defined in
mailcap.el.gz.
Value
nil
Documentation
A list of viewers preferred for different MIME types.
The elements of the list are lists of the following structure
(VIEWER MIME-TYPE TEST)
where VIEWER is either a Lisp command, e.g., a major mode, or a string containing a shell command for viewing files of the defined MIME-TYPE. In case of a shell command, %s will be replaced with the file.
MIME-TYPE is a regular expression being matched against the actual MIME type. It is implicitly surrounded with ^ and $.
TEST is a Lisp form which is evaluated in order to test if the
entry should be chosen. The test entry is optional.
When selecting a viewer for a given MIME type, the first viewer
in this list with a matching MIME-TYPE and successful TEST is
selected. Only if none matches, the standard mailcap-mime-data
is consulted.
This variable was added, or its default value changed, in Emacs 26.1.
Source Code
;; Defined in /usr/src/emacs/lisp/net/mailcap.el.gz
(defcustom mailcap-user-mime-data nil
"A list of viewers preferred for different MIME types.
The elements of the list are lists of the following structure
(VIEWER MIME-TYPE TEST)
where VIEWER is either a Lisp command, e.g., a major mode, or a
string containing a shell command for viewing files of the
defined MIME-TYPE. In case of a shell command, %s will be
replaced with the file.
MIME-TYPE is a regular expression being matched against the
actual MIME type. It is implicitly surrounded with ^ and $.
TEST is a Lisp form which is evaluated in order to test if the
entry should be chosen. The `test' entry is optional.
When selecting a viewer for a given MIME type, the first viewer
in this list with a matching MIME-TYPE and successful TEST is
selected. Only if none matches, the standard `mailcap-mime-data'
is consulted."
:version "26.1"
:type '(repeat
(list
(choice (function :tag "Function or mode")
(string :tag "Shell command"))
(regexp :tag "MIME Type")
(sexp :tag "Test (optional)")))
:get #'mailcap--get-user-mime-data
:set #'mailcap--set-user-mime-data)