[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mutt/Neomutt and mailcap



On Mi, 15 sep 21, 08:37:51, Nate Bargmann wrote:
> As there are a lot of Mutt/Neomutt users on this list, maybe someone can
> point me in the right direction.
> 
> Recently via another mailing list a message was posted that included a
> diff file with the extension of .patch.  The MIME encoding is shown as
> application/octet-stream, using Neomutt's view command.
> 
> Pressing Enter on the file name resulting in Geany (GUI text editor)
> being opened with the file.  Nothing in my ~/.mailcap nor anything in
> /etc/mailcap mapped Geany to this MIME encoding/file name.
> 
> As I hadn't been using Geany, I removed it and added the following line
> to my ~/.mailcap:
> 
> application/octet-stream; vim %s; description=Patch file; nametemplate=%s.patch
> 
> Now Neomutt calls less to show the file!
> 
> I'm left to be scratching my head as shown here:
> 
> $ neomutt -nF /dev/null -Q mailcap_path
> set mailcap_path = "~/.mailcap:/usr/share/neomutt/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap"
> 
> only ~/.mailcap and /etc/mailcap exist on my system.  I see that less
> only shows twice in /etc/mailcap for text/plain and text/*, though the
> latter is followed by a text/* that specifies vim.  In ~/.mailcp less is
> not shown anywhere.

For neomutt in buster I have this in .neomuttrc:

# neomutt disabled viewing text/* as text (except text/plain)
# re-enable common file types received (requires corresponding .mailcap entry)
auto_view text/x-diff
auto_view text/x-patch
auto_view text/x-gettext


Corresponding .mailcap entries:

text/x-diff;    nvim %s
text/x-patch;   nvim %s
text/x-gettext; nvim %s
text/x-diff;    cat %s; copiousoutput
text/x-patch;   cat %s; copiousoutput
text/x-gettext; cat %s; copiousoutput


As far as I recall the 'auto_view' and the 'copiousoutput' lines are for 
automatic display in (neo)mutt's pager, the other ones for attachment 
menu.


Hope this helps,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser

Attachment: signature.asc
Description: PGP signature


Reply to: