[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] colorized/highlighted scan output?
From: |
Lyndon Nerenberg |
Subject: |
Re: [Nmh-workers] colorized/highlighted scan output? |
Date: |
Sat, 3 Nov 2012 16:14:22 -0700 |
On 2012-11-03, at 6:16 AM, Ralph Corderoy wrote:
> There is dircolors(1) to help set LS_COLORS for ls(1) to read, e.g.
> `dircolors --print-database', but I agree with disliking hard-coding
> ANSI escape sequences.
Hardcoding is silly ;-)
You can get the sequences out of terminfo without having to use the full blown
curses interface. (tparm() if memory serves). And by using terminfo, you make
this work with more than just xterm. You also make it possible for the end user
to customize the behaviour (through custom terminfo files and their own $TERM
definitions).
Then, instead of dealing with the whole 'hardcoded variable invisible strings
into the buffer' mess, define a function that emits the escape sequence
appropriate to the colour you want.
E.g.
%(termcolor red)red text on default background%(termcolor default)back to
defaults
and
%(termcolor white/red)white text on red background%(termcolor default)regular
text
This makes it much more obvious what's going on, and simplifies keeping track
of the 'visible characters' column counter.
--lyndon
- Re: [Nmh-workers] colorized/highlighted scan output?, (continued)
- Re: [Nmh-workers] colorized/highlighted scan output?, Ken Hornstein, 2012/11/03
- Re: [Nmh-workers] colorized/highlighted scan output?, Ralph Corderoy, 2012/11/03
- Re: [Nmh-workers] colorized/highlighted scan output?, Paul Fox, 2012/11/03
- Re: [Nmh-workers] colorized/highlighted scan output?, Ralph Corderoy, 2012/11/03
- Re: [Nmh-workers] colorized/highlighted scan output?, Paul Fox, 2012/11/03
- Re: [Nmh-workers] colorized/highlighted scan output?, Ken Hornstein, 2012/11/05
- Re: [Nmh-workers] colorized/highlighted scan output?, Paul Fox, 2012/11/05
- Re: [Nmh-workers] colorized/highlighted scan output?,
Lyndon Nerenberg <=
- Re: [Nmh-workers] colorized/highlighted scan output?, Ralph Corderoy, 2012/11/03
- Re: [Nmh-workers] colorized/highlighted scan output?, Lyndon Nerenberg, 2012/11/03
Re: [Nmh-workers] colorized/highlighted scan output?, David Levine, 2012/11/02
Re: [Nmh-workers] colorized/highlighted scan output?, David Levine, 2012/11/02
Re: [Nmh-workers] colorized/highlighted scan output?, David Levine, 2012/11/02