<<< Date Index >>>     <<< Thread Index >>>

[Mutt] #2972: Have auto_view use its own command instead of consulting mailcap



#2972: Have auto_view use its own command instead of consulting mailcap

 I honestly don't know how feasible this is going to be from a backward
 compatibility standpoint, since rewriting the current auto_view syntax
 would break a lot of people's configs, but here goes:

 I think it would be a good thing if one could specify a mailcap-style
 command definition for a given MIME type, to be used (only) when
 auto_view-ing something.  That probably doesn't make a whole lot of sense,
 so let me explain the limitation in the current behaviour and contrast it
 with an example of how things would work differently with this feature
 enabled:

 The way things work now, say I wanted to set up an auto_view handler for
 JPEG files; it would have to be something with text output, of course, but
 perhaps I made a script that would run !ImageMagick's "identify" command
 on it, as well as something to dump any EXIF metadata.  The details aren't
 important; the point is that I have a script that takes a JPEG file as
 input and produces useful textual output.  :)  I can define "auto_view
 image/jpeg" in my .muttrc, and then configure Mutt's mailcap file to run
 this command, and then everything works when I bring up the message that
 the JPEG file is attached to.  Unfortunately, this means that when I open
 the attachment individually (for example, by hitting "v" and then
 selecting it), I still get the text output when what I want is to spawn an
 image viewer to actually view the picture.

 What I'm looking for is something like this:

 {{{auto_view image/jpeg "my_script ; copiousoutput"}}}

 Whatever's between the quotes is expected to be in mailcap format, and
 would get handled by the same code that currently handles that stuff.  The
 idea is that when an attachment is being displayed by auto_view, it gets
 sent to the specialized handler defined there...but when it's being
 individually opened, it gets the normal mailcap handling (in this case, it
 would be opened with an image viewer like qiv).

-- 
Ticket URL: <http://dev.mutt.org/trac/ticket/2972>