Subject: Re: bug#23184: 25.0.92; User-friendly way to override doc-view-mode as MIME viewer

From: Tassilo Horn <[email-masked]>
Date: Mon, 11 Apr 2016 19:16:06 +0200

Michael Heerdegen <[email-masked]> writes:

Hi Michael and Teemu,

>> I've just pushed the proposed change plus an addition to the Emacs
>> MIME manual.  I'm closing this bug now.
>
> Thanks.  Works well for me, and the doc also looks good.
>
> I think what Teemu means is that this solution doesn't allow to say:
> "for pdf, don't use docview, use the viewer as defined in the user's
> mailcap file".  One has to speak out the viewer's name, so there are
> two places to change when the user changes his mind about which is his
> preferred viewer (mailcap file and emacs customization).

The problems with some variable "use my ~/.mailcap for these MIME types"
are the following (when seen as an exclusive alternative to my
`mailcap-user-mime-data'):

  - I'm not sure if mailcaps are common on non-GNU/unixy systems
    (Windows, Mac OSX, ...), so that could possibly rule out users of
    such systems.

  - What would happen if a user's mailcap doesn't contain an entry for a
    given type?  Obviously, she'd need to add it there or add it to
    `mailcap-mime-data' which is not customizable and thus not very
    user-friendly.

  - What if a user want's to override a default entry with another Lisp
    alternative?  That couldn't be added to ~/.mailcap (other than with
    some emacsclient call), so it would have to be added into
    `mailcap-mime-data' _before the standard alternatives_ which is
    quite hard.

> We could allow something like (viewer . system) in
> `mailcap-user-mime-data' which would mean, more or less: consult
> `mailcap-mime-data' but skip any internal viewers.  Does that make
> sense?

Yes, that would be doable.  But wouldn't that essentially be the same as
(viewer . "xdg-open") on GNU or (viewer . "open") on Mac OSX?

Bye,
Tassilo