1%%
2%%  utility functions which Must be available (e.g., autoload)
3%%
4
5%%
6%%  A routine that trims the buffer by:  removing excess whitespace at the
7%%  end of lines and removing excess newlines
8%%
9
10define trim_buffer()
11{
12   push_spot();
13   bob();
14   do
15     {
16	eol_trim(); bol();
17	if (eolp())
18	  {
19	     go_down_1 ();
20	     while (eol_trim(), bol(),
21		    eolp() and not(eobp())) del();
22	  }
23     }
24   while (down_1 ());
25
26   bob(); eol_trim(); bol();
27   if (eolp() and not(eobp ())) del();
28   pop_spot();
29   !if (BATCH) message ("done.");
30}
31
32
33