nmh-workers
[Top] [All Lists]

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

2012-11-01 20:43:56
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?

--Ken

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>