jed-users mailing list

[2002 Date Index] [2002 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

visible tabs and spaces (tabcolors)


Is there already something like this?
Ok, I wrote something, more for fun than I
actually need it. Although the name could
be better: whitecolor, displaywhites,...
-- maybe it is useful sometimes.

%-*- mode: slang; mode: fold; -*-

% tabcolor: a function to colorize tabs and spaces

% usage e.g.
%   autoload( "tabcolor", "tabcolor.sl");
%   add_completion( "tabcolor");

% M-x tabcolor    colorize tabs and spaces
% M-x tabcolor    restore state before

% ks 2002-11-27T22:44:02

static variable m= "TABCOLOR"; %                                       %{{{
create_syntax_table(m);
define_syntax( "\d009",  '+',m); % operators
define_syntax( "\d032",  '0',m); % numbers
%}}}
static define set_color_( o, c) %                                      %{{{
{
   variable f, b;
   
   (f,b)= get_color( c);
   set_color( o, f, b);
}
%}}}
public define tabcolor() %                                             %{{{
{
   variable i, s= NULL;
   
   if ( i= blocal_var_exists( m), i)
     s= get_blocal_var( m);
   else
     create_blocal_var( m);
   
   if ( s == NULL)
     {
        s= what_syntax_table(); % returns always "DEFAULT" ?
        (s,)= what_mode(); s= strup( s);
        use_syntax_table( m);
        set_color_( "number", "string");
        set_color_( "operator", "comment");
        set_blocal_var( s, m);
     }
   else
     {
        use_syntax_table( s);
        ()= evalfile( _Jed_Color_Scheme);
        set_blocal_var( NULL, m);
     }
}
%}}}


Regards,
Klaus

[2002 date index] [2002 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]