- Subject: Re: [jed-users] whitespace?
 
- From: Guenter Milde <milde@xxxxxxxxxxxxxxxxxxxxx>
 
- Date: Fri, 16 Sep 2016 09:19:12 +0200
 
On 15.09.16, Ryan Swan wrote:
> Thanks to John E Davis and Roland Hughes for the help with the keycode mode.
> In nano, if I view a .c file, I can see unnecessary whitepace highlighted.
> For example:
> int foo(void)
> {
> 	int x = 1;
> 	return x;
> }
> after the int x = 1; line there is a tab.  Nano will highlight this.
> Can jed?  If so, how?
See for example "diffmode.sl" in http://jedmodes.sf.net/mode/diffmode
The rule is
  dfa_define_highlight_rule("[ \t]+$",       "Qtrailing_whitespace",   mode);
and it requires DFA highlight mode.
BTW: I also have (locally) a function to remove all trailing whitespace:
% Trim buffer but keep multiple blank lines:
public define trim_buffer_lines()
{
   % remove whitespace at end of lines
   push_spot_bob();
   do {
      eol_trim();
   }
   while (down_1());
   % remove empty lines at end of buffer
   eob();
   do {
      go_left_1();
      if (bolp() and eolp())
	 del();
   }
   while (bolp());
   pop_spot();
   !if (BATCH) message ("done.");
}
Günter
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.
  [2016 date index]
  [2016 thread index]
  
  [Thread Prev] [Thread Next]
      
  [Date Prev] [Date Next]