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

Re: how to view MS files within mutt?



On 2006-03-10, phyrster <phyrster@xxxxxxxxx> wrote:
> On 19:02 Wed 21 Dec 2005, Gary Johnson wrote:
> > Those two lines will let you view MS attachments from the attachment 
> > menu, which you can get to by typing 'v'.  If you want to view those 
> > attachments in-line, as you do normal messages, you'll need two 
> > additional lines in your mailcap,
> > 
> >     application/msword;antiword %s | less
> >     application/msword;antiword %s; copiousoutput
> >     application/vnd.ms-excel;xlhtml %s | html2text | less
> >     application/vnd.ms-excel;xlhtml %s | html2text; copiousoutput
> > 
> > plus this line in your muttrc:
> > 
> >     auto_view application/msword application/ms-excel
> 
> I made similar configuration in my .muttrc like this:
> 
>       auto_view text/html
>       auto_view application/octet-stream
>       auto_view application/msword
>       auto_view application/ms-excel
>       mime_lookup application/octet-stream
> 
> and in .mailcap like this:
> 
>       application/msword;antiword %s | less ; nametemplate=%s.doc; 
> copiousoutput
>       application/octet-stream;antiword %s | less ; nametemplate=%s.doc;
>       copiousoutput
>       application/octet-stream;xlhtml %s | less ; nametemplate=%s.xls;
>       copiousoutput
>       application/vnd.ms-excel;xlhtml %s | html2text | less
>       application/vnd.ms-excel;xlhtml %s | html2text; copiousoutput
> 
> With this setting, msword attachments can be rendered inline without any
> problems, but with .xls files which is taken by mutt as
> application/octet-stream, Encoding: base64 
> 
> still need me to press v and view them. What is wrong with my configuration
> and how to make .xls files display inline? 

First of all, with "mime_lookup application/octet-stream" in your
muttrc, you should not have any "application/octet-stream" lines in
your mailcap or any "autoview application/octet-stream" line in your
muttrc.  So delete those or comment them out.

One thing I see is that you have

    auto_view application/ms-excel

in your muttrc but

    application/vnd.ms-excel;...

in your mailcap.  You should have the same set of application types
in both places.  Since viewing these attachments works from the
attachment menu, it appears that the attachments have content type
application/vnd.ms-excel, so just adding this to your muttrc should
fix the problem:

    auto_view application/vnd.ms-excel

Oops.  I see now that that was my error in my earlier post.  Sorry
about that.

> 
> Also, I visited mutt's user pages about how to open attachments
> outside mutt's pager but I am not sure of the settings like this:
> 
> application/msword;             mutt_bgrun qvpview %s; test=RunningX
> application/msword;             word2text %s; copiousoutput
> 
> First question, I don't want to install qview since I want
> openoffice to open the files, how to configure Openoffice for this
> accordingly?

Just replace "qview" with "ooffice", e.g.,

    application/msword;     mutt_bgrun ooffice %s; test=RunningX

> 
> Second question, mutt_bgrun means? I can't find this in mutt's manual.

mutt_bgrun is a script that puts the viewer in the background so
that mutt can continue to run while you view the attachment.  More
information and the script itself can be found here:

    http://www.spocom.com/users/gjohnson/mutt/#background

> I also want to view image files via zgv (perhaps in mutt's pager)
> or gqview (outside mutt), how to configure them for mutt? 

This is explained here:

    http://www.spocom.com/users/gjohnson/mutt/#mime

HTH,
Gary

-- 
Gary Johnson                               | Agilent Technologies
garyjohn@xxxxxxxxxxxxxxx                   | Wireless Division
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA