On k, febr 25, 2014 at 08:25:12 +1100, Cameron Simpson wrote: > On 24Feb2014 21:45, LEVAI Daniel <l...@ecentrum.hu> wrote: > > On h, febr 24, 2014 at 21:32:23 +0100, Timo Schmidt wrote: > > > See http://www.mutt.org/doc/devel/manual.html#tab-attachment-bindings > > > in particular: > > > <view-mailcap> m force viewing of attachment using mailcap > > > > Wow, you win. > > > > But this doesn't make sense: > > > > Using these mailcap entries: > > > > text/html; google-chrome %s; nametemplate=%s.html; test=test -n "$DISPLAY" > > text/html; lynx -stdin -dump -force_html; copiousoutput > > > > ... without `auto_view text/html` pressing <Space> on the text/html MIME > > part it just displays the raw HTML, but with `auto_view text/html` Mutt > > chooses to use the *last* mailcap entry, and ignore the one before it?! > > The "copiousoutput" flag is the key item here. "needsterminal" is > for interactive tools and copiusoutput is for tools that mutt expects > to page for you. > > So all my mailcaps come in pairs: one with copiousoutput for inline viewing > and the other to open a tool to view the attachment. Example: > > image/x-png; ah %s -1 xv; gui > image/x-png; env DISPLAY= iminfo %s; copiousoutput > > The copiousoutput one is used when showing the image in the message > view, and just recites some image parameters (size, etc) using my > "iminfo" script. The other one is chosen when I just press enter > (<view-attach>) in the attachments view. "ah" is a helper script > of my own, but it fires up "xv" to display the image.
Except "the other one" doesn't work. When I press enter in the attachments view, it either displays raw HTML (which it should not, without `auto_view text/html`) or uses the copiousoutput mailcap entry (which it should, with `auto_view text/html`). My understanding of "view attachment using mailcap entry if necessary" is that it uses the mailcap entry, when it is present. Which it fails to do so. There is a difference between inlining the copiousoutput mailcap entry's output in the message display, and pressing <Enter> or <Space> on the mime part in the attachments view. In the latter case, Mutt should use the mailcap entry, and not just when one forces it to do so, with 'm'. Daniel -- LÉVAI Dániel PGP key ID = 0x83B63A8F Key fingerprint = DBEC C66B A47A DFA2 792D 650C C69B BE4C 83B6 3A8F