backlighting
Tony Balinski
ajbj at free.fr
Wed Feb 27 19:57:48 CET 2008
Quoting local <kuzn at htsc.mephi.ru>:
> Hi,
>
> There is commented code in macro.c and help.etx which is disabled
> for NEdit 5.4. The code implements the variable $backlight_string
> and the function set_backlight_string() allowing to operate by
> backlighting via macro.
>
> $backlight_string
> The current value of the window's backlighting specification.
> This is empty if backlighting is turned off. It can be changed
> through calls to the built-in macro function set_backlight_string().
>
> set_backlight_string( [string] )
> Applies the given string, which should be in the format of the
> nedit*backlightCharTypes X resource, to the current text window,
> turning on backlighting. If the value of the string passed is
> "default", or if no parameter is passed, the nedit.backlightCharTypes
> X resource's own value will be used. If the empty string, "",
> is passed, backlighting will be turned off.
>
> The uncommented code is well compiled and stable works.
> Is there a reason to neglect this code?
The code works; in fact I use it from time to time. The interface, though,
is very unfriendly. What's really needed is something that allows you to
modify the backlighting a bit at a time, eg
set_backlighting("red", "\x01-\x1f")
set_backlighting("lightgrey", "\t")
set_backlighting("white", "abcdefghijklmnopqrstuvwxyz")
and
col = get_backlighting(c)["rgb"]
say. This can be done by manipulating the backlighting resource for the
text widget.
I wrote this stuff ages ago, around the same time as the initial rangeset
stuff. I use it daily to check for tabs and trailing spaces in my files.
My own patched build turns all that stuff on again, then adds some more
(foreground "backlighting", taking precedence over SH, aimed at providing
visible spaces one day). But it can certainly be improved.
Tony
More information about the Discuss
mailing list