home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!news.claremont.edu!nntp-server.caltech.edu!SOL1.GPS.CALTECH.EDU!CARL
- From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
- Newsgroups: comp.os.vms
- Subject: Re: TPU: proc to delete trailing spaces
- Date: 23 Dec 1992 14:03:43 GMT
- Organization: HST Wide Field/Planetary Camera
- Lines: 39
- Distribution: world
- Message-ID: <1h9rjvINN1c9@gap.caltech.edu>
- References: <1992Dec23.062138.3034@hubcap.clemson.edu>
- Reply-To: carl@SOL1.GPS.CALTECH.EDU
- NNTP-Posting-Host: sol1.gps.caltech.edu
-
- In article <1992Dec23.062138.3034@hubcap.clemson.edu>, rsimms@hubcap.clemson.edu (Robert Simms) writes:
- =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);
-
- Wouldn't it be easier to
-
- define_key ('eve$trim_buffer(current_buffer)', CTRL_P_KEY);
-
- Digital had it first!
- --------------------------------------------------------------------------------
- Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL
-
- Disclaimer: Hey, I understand VAXen and VMS. That's what I get paid for. My
- understanding of astronomy is purely at the amateur level (or below). So
- unless what I'm saying is directly related to VAX/VMS, don't hold me or my
- organization responsible for it. If it IS related to VAX/VMS, you can try to
- hold me responsible for it, but my organization had nothing to do with it.
-