Can one suppress the '[-- Autoview using ....--] message?
Is there any way to suppress the Autoview message when messages come via a .mailcap entry? -- Chris Green
Re: How to 'hook' different programs to view text/html?
On Tue, Jan 18, 2022 at 08:34:18PM +, Chris Green wrote: > On Tue, Jan 18, 2022 at 12:28:42PM -0800, Kevin J. McCarthy wrote: > > On Tue, Jan 18, 2022 at 05:44:04PM +, Chris Green wrote: > > > Is there a straightforward way to do this? It's easy enough to use a > > > message hook to catch the messages from the site but what do I need to > > > do then to convert the messages and feed them into the pager? > > > > You could use the mailcap 'test=' field combined with an environment > > variable set/unset by the hook. > > > > message-hook ~A 'unsetenv MUTT_USE_ALT_VIEWER' > > message-hook ~C 'your-l...@example.com' 'setenv MUTT_USE_ALT_VIEWER yes' > > > > In .mailcap: > > > > text/html; altviewer %s; test=[ -n "$MUTT_USE_ALT_VIEWER" ]; copiousoutput; > > nametemplate=%s.html > > text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html > > > > Another idea might be to swap $mailcap_path to use another mailcap file for > > that mailing list. > > > Thanks, yes, those are possibilities. I'll experiment. :-) > The .mailcap switching works perfectly, thank you. My alternative 'lynx -dump' is just a wrapper for lynx so slots very nicely into a .mailcap. Thank you. -- Chris Green
Re: How to 'hook' different programs to view text/html?
On Tue, Jan 18, 2022 at 12:28:42PM -0800, Kevin J. McCarthy wrote: > On Tue, Jan 18, 2022 at 05:44:04PM +, Chris Green wrote: > > Is there a straightforward way to do this? It's easy enough to use a > > message hook to catch the messages from the site but what do I need to > > do then to convert the messages and feed them into the pager? > > You could use the mailcap 'test=' field combined with an environment > variable set/unset by the hook. > > message-hook ~A 'unsetenv MUTT_USE_ALT_VIEWER' > message-hook ~C 'your-l...@example.com' 'setenv MUTT_USE_ALT_VIEWER yes' > > In .mailcap: > > text/html; altviewer %s; test=[ -n "$MUTT_USE_ALT_VIEWER" ]; copiousoutput; > nametemplate=%s.html > text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html > > Another idea might be to swap $mailcap_path to use another mailcap file for > that mailing list. > Thanks, yes, those are possibilities. I'll experiment. :-) -- Chris Green
Re: How to 'hook' different programs to view text/html?
On Tue, Jan 18, 2022 at 05:44:04PM +, Chris Green wrote: Is there a straightforward way to do this? It's easy enough to use a message hook to catch the messages from the site but what do I need to do then to convert the messages and feed them into the pager? You could use the mailcap 'test=' field combined with an environment variable set/unset by the hook. message-hook ~A 'unsetenv MUTT_USE_ALT_VIEWER' message-hook ~C 'your-l...@example.com' 'setenv MUTT_USE_ALT_VIEWER yes' In .mailcap: text/html; altviewer %s; test=[ -n "$MUTT_USE_ALT_VIEWER" ]; copiousoutput; nametemplate=%s.html text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html Another idea might be to swap $mailcap_path to use another mailcap file for that mailing list. -- Kevin J. McCarthy GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA signature.asc Description: PGP signature
Re: How to 'hook' different programs to view text/html?
On Tue, Jan 18, 2022 at 11:04:40PM +0300, Jean Louis wrote: > * Chris Green [2022-01-18 20:45]: > > I have the fairly standard setup for viewing HTML messages in mutt:- > > > > auto_view text/html > > unalternative_order * > > message-hook ~A "alternative_order text/html text/plain text" > > > > (The unalternative_order is because I have one special case where I > > switch the order of text/html text/plain) > > > > ... and in ~/.mailcap:- > > > > text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html > > > > > > > > However I now have a requirement where I want to run HTML messages > > from one particular mailing list (well, it's a forum actually, but I > > get the messages by E-Mail) through a program other than lynx. > > > > Is there a straightforward way to do this? It's easy enough to use a > > message hook to catch the messages from the site but what do I need to > > do then to convert the messages and feed them into the pager? > > I am sure you can, instead of individual program, run a dmenu or other > similar menu in console, maybe such as fzf, or console dialogs and > then choose by which program to open the html files. > I don't want to have to interact with things at all, I just want messages from one particular address to be filtered through a different HTML parser than the default lynx. The messages should just appear in my mutt pager automatically like all other messages. -- Chris Green
Re: How to 'hook' different programs to view text/html?
On Tue, Jan 18, 2022 at 05:44:04PM +, Chris Green wrote: > I have the fairly standard setup for viewing HTML messages in mutt:- > > auto_view text/html > unalternative_order * > message-hook ~A "alternative_order text/html text/plain text" > > (The unalternative_order is because I have one special case where I > switch the order of text/html text/plain) > > ... and in ~/.mailcap:- > > text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html > > > > However I now have a requirement where I want to run HTML messages > from one particular mailing list (well, it's a forum actually, but I > get the messages by E-Mail) through a program other than lynx. > > Is there a straightforward way to do this? It's easy enough to use a > message hook to catch the messages from the site but what do I need to > do then to convert the messages and feed them into the pager? > Could display_filter help? I.e. can I use a message_hook to set display_filter when the message is from the list in question and unset display_filter by default (i.e. for all other messages)? -- Chris Green
Re: How to 'hook' different programs to view text/html?
* Chris Green [2022-01-18 20:45]: > I have the fairly standard setup for viewing HTML messages in mutt:- > > auto_view text/html > unalternative_order * > message-hook ~A "alternative_order text/html text/plain text" > > (The unalternative_order is because I have one special case where I > switch the order of text/html text/plain) > > ... and in ~/.mailcap:- > > text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html > > > > However I now have a requirement where I want to run HTML messages > from one particular mailing list (well, it's a forum actually, but I > get the messages by E-Mail) through a program other than lynx. > > Is there a straightforward way to do this? It's easy enough to use a > message hook to catch the messages from the site but what do I need to > do then to convert the messages and feed them into the pager? I am sure you can, instead of individual program, run a dmenu or other similar menu in console, maybe such as fzf, or console dialogs and then choose by which program to open the html files. -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/
How to 'hook' different programs to view text/html?
I have the fairly standard setup for viewing HTML messages in mutt:- auto_view text/html unalternative_order * message-hook ~A "alternative_order text/html text/plain text" (The unalternative_order is because I have one special case where I switch the order of text/html text/plain) ... and in ~/.mailcap:- text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html However I now have a requirement where I want to run HTML messages from one particular mailing list (well, it's a forum actually, but I get the messages by E-Mail) through a program other than lynx. Is there a straightforward way to do this? It's easy enough to use a message hook to catch the messages from the site but what do I need to do then to convert the messages and feed them into the pager? -- Chris Green