- Subject: Re: [jed-users] rm trailing whitespace on write
- From: Bernhard Seckinger <bernhard.seckinger@xxxxxx>
- Date: Thu, 16 Feb 2017 09:09:56 +0100
Hi pdg,
> Anybody have a mechanism to remove trailing whitespace
> on buffer write (or read I guess).
I'm not sure, if this is, what you're looking for, but I use the following in
my .jedrc to remove trailing whitespaces, whenever I save the buffer:
define my_trim_buffer()
{
push_spot();
while (up_1()) { eol_trim(); bol(); }
pop_spot();
push_spot();
while (down_1()) { eol_trim(); bol(); }
pop_spot();
}
add_to_hook("_jed_save_buffer_before_hooks",&my_trim_buffer);
Note, that it does not remove empty lines at the end of the buffer.
Cheers, Berni
--
-- Meine Rätselwebseite: www.croco-puzzle.com
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.
[2017 date index]
[2017 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]