HEX
Server: Apache
System: Linux pdx1-shared-a2-09 6.6.116-grsec-jammy-dirty #1 SMP Sat Nov 8 00:02:42 UTC 2025 x86_64
User: dh_pvsc7i (5084578)
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.");
}