[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] colorized/highlighted scan output?

From: Ken Hornstein
Subject: Re: [Nmh-workers] colorized/highlighted scan output?
Date: Thu, 01 Nov 2012 21:43:32 -0400

>I tried adding some raw ANSI escape sequences to a scan
>format to colorize the cur and unseen messages, and they
>sort of work.  I get the desired effects, but scan loses
>track of how many characters are actually displayed so there
>are some annoyances.  They should be easy to fix.

I don't have a better way to colorize things like cur and unseen ... but
this touches on something I've been meaning to work on.

Right now fmt_scan() takes a parameter that is "width", which is used to
limit how many characters it will output.  The problem is that's also used
to mean the buffer size, and of course nowadays one column doesn't always
equal one byte.  I run into this with UTF-8 output in scan; the columns
line up properly, but it doesn't output a whole line.

My thinking was to add an extra parameter to fmt_scan() that meant the buffer
size available and limit the output based on both the number of characters
and the total buffer size.  This is easy enough to do, but I realize that
it has bearing on your problem because it's a similar issue; you want to
output some bytes in scan that won't take up any columns, so I'm wondering
if there is some overlap to our problems here.

My issue is straightforward and doesn't require any user-visible changes,
but I am thinking your issue might.  I am wondering if you've thought about
how you'd make this work; maybe a format escape that says, "Don't count
these characters against the width total?"  Or something else?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]