home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.vms
- Path: sparky!uunet!gatech!hubcap!rsimms
- From: rsimms@hubcap.clemson.edu (Robert Simms)
- Subject: TPU: proc to delete trailing spaces
- Message-ID: <1992Dec23.062138.3034@hubcap.clemson.edu>
- Keywords: tpu procedure
- Organization: Clemson University
- Date: Wed, 23 Dec 1992 06:21:38 GMT
- Lines: 30
-
- Together with a friend, I came up with the following procedure
- that I keep in my tpu$command file:
-
- procedure eve_erase_trailing_spaces
- local count, kill_range;
- count := 0;
- loop exitif 0 = search_quietly ( (span(" ")@ kill_range) & line_end,
- forward);
- position (kill_range);
- erase (kill_range);
- count := count +1;
- endloop;
- if count = 0
- then
- message('No trailing spaces found.');
- else
- message('Trailing spaces removed from '+str(count)+' lines.');
- endif;
- endprocedure;
-
-
- I also assign it to the Ctrl-P key for easy execution:
-
- define_key ('eve_erase_trailing_spaces' ,CTRL_P_KEY);
-
- - Rob
- --
- Robert Simms | rsimms@hubcap.clemson.edu
- Department of Math Sciences | or rsimms@gemini.clemson.edu
- Clemson University, Clemson, SC 29634 | or rsimms@math.clemson.edu
-