[working hack found] Re: Invoking an alternative command on a MIME part

2015-04-28 Thread martin f krafft
also sprach Cameron Simpson  [2015-04-28 04:17 +0200]:
> Sounds like a job for a mutt macro. A first cut would be to write
> a macro which pointed $mailcap_path at a different mailcap file,
> then ran view-attach, then restored the old value.

Yes! This idea led me to a working solution^W hack:

  set mailcap_path=~/.mailcap-edit-wrapper

and that file then contains entries for all types such as:

  application/*; chmod +w %s && run-mailcap --action=edit %t:%s

Unfortunately, the main type ("application") cannot be wildcarded,
but there's only a limited set of those, so no big deal. The chmod
is needed since mutt saves the temporary file read-only.

So now it's easy to create a macro as you describe above, allowing
me to map 'e' to "editing an attachment".

Thanks for your help!

-- 
@martinkrafft | http://madduck.net/ | http://two.sentenc.es/
 
the uncertainty principle:
  you can never be sure how many
  beers you had last night.
 
spamtraps: madduck.bo...@madduck.net


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)


Re: Invoking an alternative command on a MIME part

2015-04-28 Thread martin f krafft
also sprach Luis Mochan  [2015-04-28 04:36 +0200]:
> What I do in similar situations is pipe the attachment to a helper
> (I call it muttfilter) that accepts as first argument a file name,

Oh, but now you need a different pipe depending on the file type,
e.g. for PDF and PNG. I don't really want that as mailcap already
handles this.

-- 
@martinkrafft | http://madduck.net/ | http://two.sentenc.es/
 
"love is a grave mental disease."
 -- platon
 
spamtraps: madduck.bo...@madduck.net


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)


vs. (was: Invoking an alternative command on a MIME part)

2015-04-28 Thread martin f krafft
also sprach Cameron Simpson  [2015-04-28 04:17 +0200]:
> I do not properly understand  versus .
> I would appreciate someone else chiming in here.

I think the difference is that  tries to render inline
(e.g. text/plain) and only resorts to run-mailcap when it has not
internal viewer.  skips the internal viewers and
always goes via mailcap.

-- 
@martinkrafft | http://madduck.net/ | http://two.sentenc.es/
 
beware of bugs in the above code;
i have only proved it correct, not tried it.
-- donald e. knuth
 
spamtraps: madduck.bo...@madduck.net


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)


Re: Invoking an alternative command on a MIME part

2015-04-28 Thread Luis Mochan
> Oh, but now you need a different pipe depending on the file type,
> e.g. for PDF and PNG. I don't really want that as mailcap already
> handles this.
I use it only when I want to override mailcap for whatever
reason, and then I specify the program I want to use in the pipe
command. Otherwise I simply use  or m to view-attach or
view-mailcap.
Regards,
Luis



signature.asc
Description: Digital signature


display html email in browser?

2015-04-28 Thread Peter P.
Dear fellow mutt users,

Is there a way to have an html email rendered and displayed in a browser
window? I tried saving the html message part to disk and opened that
file, but there was no formatting, and some symbols were wrong.

Motivation: Wanting to print a few html emails in their original form
("in full glory"), not rendered through w3m, but wanting to get rid of
icedove/thunderbird, which I am keeping just for that.

Thanks for ideas!
P


Re: display html email in browser?

2015-04-28 Thread Francesco Ariis
On Tue, Apr 28, 2015 at 12:09:34PM -0400, Peter P. wrote:
> Dear fellow mutt users,
> 
> Is there a way to have an html email rendered and displayed in a browser
> window?

Hello Peter,
once opened the message, press 'v' (view-attachments) and then
select the .html one and press , that should auto-invoke
x-www-browser.



Re: display html email in browser?

2015-04-28 Thread Peter P.
* Francesco Ariis  [2015-04-28 12:47]:
> On Tue, Apr 28, 2015 at 12:09:34PM -0400, Peter P. wrote:
> > Dear fellow mutt users,
> > 
> > Is there a way to have an html email rendered and displayed in a browser
> > window?
> 
> Hello Peter,
> once opened the message, press 'v' (view-attachments) and then
> select the .html one and press , that should auto-invoke
> x-www-browser.
Thanks Francesco,
That way the message gets displayed inside mutt using w3m. In my .muttrc I have 
set 
auto_view text/html application/x-pgp-message
and
text/html; /usr/bin/w3m -dump -T text/html '%s'; copiousoutput; 
description=HTML Text; nametemplate=%s.html
as the corresponding mailcap entry.
I wonder if I could pipe the html message part to the browser. The way I
did it, typing "|" and specifying firefox as the program to pipe it to,
did not really render it nicely.

best, P


Re: display html email in browser?

2015-04-28 Thread Peter Davis
"Peter P."  writes:

> * Francesco Ariis  [2015-04-28 12:47]:
>> On Tue, Apr 28, 2015 at 12:09:34PM -0400, Peter P. wrote:
>> > Dear fellow mutt users,
>> > 
>> > Is there a way to have an html email rendered and displayed in a browser
>> > window?
>> 
>> Hello Peter,
>> once opened the message, press 'v' (view-attachments) and then
>> select the .html one and press , that should auto-invoke
>> x-www-browser.
> Thanks Francesco,
> That way the message gets displayed inside mutt using w3m. In my .muttrc I 
> have set 
>   auto_view text/html application/x-pgp-message
> and
>   text/html; /usr/bin/w3m -dump -T text/html '%s'; copiousoutput; 
> description=HTML Text; nametemplate=%s.html
> as the corresponding mailcap entry.
> I wonder if I could pipe the html message part to the browser. The way I
> did it, typing "|" and specifying firefox as the program to pipe it to,
> did not really render it nicely.

You can definitely do this, but I suspect most browsers are not designed
to accept input from stdin (a pipe). You can write a script to save the
HTML part in a temp file, and then display that in the browser. There
are actually a number of such scripts around if you Google it.

-pd


-- 

Peter Davis
The Tech Curmudgeon
www.techcurmudgeon.com


Re: display html email in browser?

2015-04-28 Thread Francesco Ariis
On Tue, Apr 28, 2015 at 01:02:52PM -0400, Peter P. wrote:
> Thanks Francesco,
> That way the message gets displayed inside mutt using w3m. In my .muttrc I 
> have set 
>   auto_view text/html application/x-pgp-message
> and
>   text/html; /usr/bin/w3m -dump -T text/html '%s'; copiousoutput; 
> description=HTML Text; nametemplate=%s.html
> as the corresponding mailcap entry.
> I wonder if I could pipe the html message part to the browser. The way I
> did it, typing "|" and specifying firefox as the program to pipe it to,
> did not really render it nicely.

Mhhh I am a puzzled on why saving (or piping, for what matters) ends
up in a corrupted result. Which symbols were wrong? Do you think you can
share the .html attachment or at least a picture depicting the missing
formatting?


Re: display html email in browser?

2015-04-28 Thread Grant Edwards
On 2015-04-28, Peter P.  wrote:
> * Francesco Ariis  [2015-04-28 12:47]:
>> On Tue, Apr 28, 2015 at 12:09:34PM -0400, Peter P. wrote:
>> > Dear fellow mutt users,
>> > 
>> > Is there a way to have an html email rendered and displayed in a browser
>> > window?
>> 
>> Hello Peter,
>> once opened the message, press 'v' (view-attachments) and then
>> select the .html one and press , that should auto-invoke
>> x-www-browser.
> Thanks Francesco,
> That way the message gets displayed inside mutt using w3m.

Yep.  What many of us do is use w3m to view inside mutt, and then
define a 'print' command to view it externally:

  text/html; w3m -T text/html -dump; copiousoutput; print = firefoxurl %s;

-firefoxurl
#!/bin/bash
MRC="firefox -remote"
URL="$1"
CMD="${2:-new-tab}"
echo "$0 '$1' '$2'" >/dev/tty
test -f "$URL" && URL="file://$URL"
expr match "$URL" '.*://.*' >/dev/null || URL="http://$URL";
if $MRC 'ping()' 2>/dev/null ; then
  echo  'firefox already running'
  echo   $MRC "openURL($URL,$CMD)"
  $MRC "openURL($URL,$CMD)"
else
  echo  'firefox not running'
  echo   firefox "$URL"
  firefox "$URL"
fi  
---

So after you hit 'v' so see the attachments, select the html one and
hit 'p'

-- 
Grant Edwards   grant.b.edwardsYow! Am I elected yet?
  at   
  gmail.com



Re: display html email in browser?

2015-04-28 Thread Larry Hynes
On 2015-04-28, Peter P.  wrote:
> Dear fellow mutt users,
>
> Is there a way to have an html email rendered and displayed in a browser
> window? I tried saving the html message part to disk and opened that
> file, but there was no formatting, and some symbols were wrong.

I use muttils (https://bitbucket.org/blacktrash/muttils) for
this very purpose. By default it maps, iirc, F7 to 'view in
browser' and F8 to 'view safely in browser' i.e. don't download
images, etc. This way I can still autoview html parts with w3m.

hth,

larry

>
> Motivation: Wanting to print a few html emails in their original form
> ("in full glory"), not rendered through w3m, but wanting to get rid of
> icedove/thunderbird, which I am keeping just for that.
>
> Thanks for ideas!
> P
>



Re: display html email in browser?

2015-04-28 Thread Grant Edwards
On 2015-04-28, Grant Edwards  wrote:

> Yep.  What many of us do is use w3m to view inside mutt, and then
> define a 'print' command to view it externally:
>
>   text/html; w3m -T text/html -dump; copiousoutput; print = firefoxurl %s;

Uh, in case your crystal ball was broken, that's a line from ~/.mimecap.

-- 
Grant Edwards   grant.b.edwardsYow! Is this an out-take
  at   from the "BRADY BUNCH"?
  gmail.com



Re: display html email in browser?

2015-04-28 Thread Grant Edwards
On 2015-04-28, Grant Edwards  wrote:
> On 2015-04-28, Grant Edwards  wrote:
>
>> Yep.  What many of us do is use w3m to view inside mutt, and then
>> define a 'print' command to view it externally:
>>
>>   text/html; w3m -T text/html -dump; copiousoutput; print = firefoxurl %s;
>
> Uh, in case your crystal ball was broken, that's a line from ~/.mimecap.

Aargh. it's .mailcap, not .mimecap.

-- 
Grant Edwards   grant.b.edwardsYow! Hand me a pair of
  at   leather pants and a CASIO
  gmail.comkeyboard -- I'm living
   for today!



How best to build on Ubuntu (15.04) ?

2015-04-28 Thread Xu Wang
Dear Mutt users,

I am quite happy to begin using Mutt. I would like to build Mutt on
Ubuntu 15.04. However, I am confused because of all the different
patches there exist. Does someone have a script that they would be
interested in sharing which does a build that is sensible? For
example, how to build the equivalent of mutt-patched? Or do you have
recommendations for a different set of patches to apply?

Thank you and kind regards,

Xu