On Tue, Oct 27, 2009 at 09:57:39PM -0700, Gary Johnson wrote:
> On 2009-10-28, Horacio Sanson <hsan...@gmail.com> wrote:
> > Does anyone know how to make mutt display patches/diff files in color?
> > 
> > I am using pygmentize that in a terminal outputs the diff/patch files with 
> > easy to read
> > colors but when used from within mutt the text is displayed correctly but 
> > not colored.
> > 
> > Here is my configuration:
> > 
> > My .mailcap file:
> > 
> >   text/x-diff;pygmentize -f console %s;copiousoutput
> >   text/x-patch;pygmentize -f console %s;copiousoutput
> > 
> > My .muttrc file:
> > 
> >   auto_view text/x-diff
> >   auto_view text/x-patch
> > 
> > 
> > I can see in Mutt that the pygmentize command is being called but the output
> > text is not colored on the console.
> 
> Try this in your .muttrc:
> 
>     set allow_ansi
>

Thanks a lot... Now all patch/diff files are beautifully displayed in Mutt. 
Using
pygmentize I can potentially colorize all text attachments.

> > As second question how do I change the mime type of received emails based on
> > extension? without using procmail? Some times I get patches/diff with 
> > mime-type
> > set to plain/text and I want to change them to text/x-patch or text/x-diff
> > based on extension. 
> 
> This was originally intended for application/octet-stream but was
> generalized to handle other MIME types.  I don't know whether it
> will work for text/plain.  Look in the mutt manual for
> 'mime_lookup'.
> 

This also seemed to work very well. So far all files with patch or diff
extensions appear as text/x-diff mime.

> HTH,
> Gary
> 
> 

-- 
regards,
Horacio Sanson

Reply via email to