HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/jed/lib/util.sl
%%
%%  utility functions which Must be available (e.g., autoload)
%%

%%
%%  A routine that trims the buffer by:  removing excess whitespace at the
%%  end of lines and removing excess newlines
%%

define trim_buffer()
{
   push_spot();
   bob();
   do
     {
	eol_trim(); bol();
	if (eolp())
	  {
	     go_down_1 ();
	     while (eol_trim(), bol(),
		    eolp() and not(eobp())) del();
	  }
     }
   while (down_1 ());

   bob(); eol_trim(); bol();
   if (eolp() and not(eobp ())) del();
   pop_spot();
   ifnot (BATCH) message ("done.");
}