On 2017-04-25 12:36:01 -0700, Kevin J. McCarthy wrote:
> On Tue, Apr 25, 2017 at 12:49:05PM -0500, Derek Martin wrote:
> > On Mon, Apr 24, 2017 at 11:33:20AM +0200, Vincent Lefevre wrote:
> > > On 2017-04-23 09:59:33 -0500, Derek Martin wrote:
> > > > Although, I don't really get why Mutt needs a feature for this, when
> > > > you can just set the environment variables in... the environment.
> > > > Before starting Mutt.
> > > 
> > > This is not just possible for all of them. One problem is COLUMNS,
> > > which may be needed for filters not attached to the terminal.
> > 
> > I don't get it...  I'm not sure how COLUMNS is even useful to filters
> > that aren't attached to the terminal.

The output of a filter will be displayed on the terminal, so that
some filters (those that do formatting themselves, such as lynx)
may need to know the width of the pager.

> > And if they are, they should be able to get the terminal's
> > dimensions.

Mailcap filters are not attached to the terminal. I don't know whether
this can be regarded as a bug in Mutt, but anyway:
  * filters are just filters and are not intended to interact with
    the terminal (so, the current behavior is safer);
  * programs that are intended to work as filters won't try to get
    information from the terminal, so that they would need a wrapper
    to get the width and set up $COLUMNS, which is not nice for the
    end user.

> But, for the sake of argument:
> 
> This is helpful when using the sidebar.  In this case, Mutt sets COLUMNS
> to the width of the pager area, not the whole window.  I have in my
> .mailcap :
>   text/html; lynx -dump -width ${COLUMNS:-80} %s; nametemplate=%s.html; 
> copiousoutput
> which looks much nicer.

This is useful even without using the sidebar. If one uses a terminal
larger than 80 columns, one may want an output on more than 80 columns
(80 columns is the default width used by lynx -dump, as documented).

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to