nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] configurable part separator lines

2014-04-29 14:46:06
it seems that if i use mh-format coloring in my mhshow marker
line, that the color gets reset at the end of the marker line
whether i include a resetterm sequence or not.  i see that scan.curses
explicitly provides resetterm, so now i'm wondering if what
i'm seeing with mhshow markers is a bug or a feature?

I know you already figured out that it was "less" doing that, but I wanted
to explain why that resetterm sequence was there, and a bit of extra magic
involved.

mh-format(5) has the concept of "width" - the number of printable columns
that it should output.  It used to be that "width" was the buffer size,
but that isn't quite sufficient nowadays.  So now mh-format will keep
track of the column width, and appropriately handle the case of multibyte
character sets (it also can handle the case of zero-width characters,
such as combining Unicode sequences, assuming that wcwidth() is doing
the right thing).  Because of that, %(zputlit) was created so you could
output characters that didn't count against column width.

Because mh-format(5) output cuts off after you exceed width, you'd normally
never output the final characters and thus the terminal would never get reset.
So there's special code that goes through and processes any zputlit
instructions and makes sure they always get output, even if width has
been exceeded.

--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>