Can index lines be wrapped?

nunojsilva at ist.utl.pt nunojsilva at ist.utl.pt
Sat Aug 14 08:05:17 UTC 2021


On 2021-08-13, Cameron Simpson wrote:

> On 13Aug2021 08:17, Chris Green <cl at isbd.net> wrote:
>>On Fri, Aug 13, 2021 at 08:15:26AM +0200, Alexander Dahl wrote:
>>> On Thu, Aug 12, 2021 at 08:30:11AM +0100, Chris Green wrote:
>>> > I read my mail (via ssh) on quite a variety of devices, one is an
>>> > Android phone running termux which has rather short lines which
>>> > truncate much of the subject in index view.
>>> >
>>> > I could rearrange the index_format but that would change it for all my
>>> > viewing devices and I don't really want to do that, and anyway I'd
>>> > still lose some information.
>>>
>>> What about a macro or shortcut to toggle between different settings?
>>>
>>That's possible but it's just one more thing that one has to to
>>manually which isn't really necessary.
>
> I always invoke via a script (named "+") which has assorted 
> figure-it-out logic before invoking mutt. You could sniff the terminal 
> size and choose a narrower index_format for narrow terminals. (_And_ 
> bind that to a keyboard toggle macro as well if you wanted.)
>
> I've got a ttysize script which does this:
>
>     stty -a </dev/tty \
>     | sed -n '
>           s/.* rows \([0-9][0-9]*\); columns \([0-9][0-9]*\).*/\2 \1/p
>           t
>           s/.*; *\([0-9][0-9]*\) rows; *\([0-9][0-9]*\) columns.*/\2 \1/p
>           t'
>
> but I'm sure there must be a more direct way.
>
> Anyway, given the tty width you could make a choice about index_format.
>
> Cheers,
> Cameron Simpson <cs at cskk.id.au>
>

I've had this problem with gpg key selection menus. Customizing a format
probably didn't occur to me when I asked about this in 2018[0], but,
looking at manual.txt, I should try customizing pgp_entry_format.

While changing formats will help mitigating the problem, I expect it to
resurface occasionally. I wonder if there's anything that could be done
in general to avoid truncated lines or to make these readable - either
allowing left-right scroll or having a "line-wrap mode" for indices?

(Or is one of these a mutt feature I haven't learned about yet?)

[0] news://news.gmane.io/pq6sad$sp4$1@blaine.gmane.org
    or http://marc.info/?i=pq6sad$sp4$1@blaine.gmane.org

-- 
Nuno Silva



More information about the Mutt-users mailing list