home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / vms / 19783 < prev    next >
Encoding:
Internet Message Format  |  1992-12-23  |  1.9 KB

  1. Path: sparky!uunet!news.claremont.edu!nntp-server.caltech.edu!SOL1.GPS.CALTECH.EDU!CARL
  2. From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: TPU:  proc to delete trailing spaces
  5. Date: 23 Dec 1992 14:03:43 GMT
  6. Organization: HST Wide Field/Planetary Camera
  7. Lines: 39
  8. Distribution: world
  9. Message-ID: <1h9rjvINN1c9@gap.caltech.edu>
  10. References: <1992Dec23.062138.3034@hubcap.clemson.edu>
  11. Reply-To: carl@SOL1.GPS.CALTECH.EDU
  12. NNTP-Posting-Host: sol1.gps.caltech.edu
  13.  
  14. In article <1992Dec23.062138.3034@hubcap.clemson.edu>, rsimms@hubcap.clemson.edu (Robert Simms) writes:
  15. =Together with a friend, I came up with the following procedure
  16. =that I keep in my tpu$command file:
  17. =
  18. =procedure eve_erase_trailing_spaces
  19. =   local count, kill_range;
  20. =   count := 0;
  21. =   loop exitif 0 = search_quietly ( (span(" ")@ kill_range) & line_end,
  22. =                        forward);
  23. =        position (kill_range);
  24. =        erase (kill_range);
  25. =        count := count +1;
  26. =   endloop;
  27. =   if count = 0
  28. =   then
  29. =      message('No trailing spaces found.');
  30. =   else
  31. =      message('Trailing spaces removed from '+str(count)+' lines.');
  32. =   endif;
  33. =endprocedure;
  34. =
  35. =
  36. =I also assign it to the Ctrl-P key for easy execution:
  37. =
  38. =define_key ('eve_erase_trailing_spaces'    ,CTRL_P_KEY);
  39.  
  40. Wouldn't it be easier to
  41.  
  42. define_key ('eve$trim_buffer(current_buffer)', CTRL_P_KEY);
  43.  
  44. Digital had it first!
  45. --------------------------------------------------------------------------------
  46. Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL
  47.  
  48. Disclaimer:  Hey, I understand VAXen and VMS.  That's what I get paid for.  My
  49. understanding of astronomy is purely at the amateur level (or below).  So
  50. unless what I'm saying is directly related to VAX/VMS, don't hold me or my
  51. organization responsible for it.  If it IS related to VAX/VMS, you can try to
  52. hold me responsible for it, but my organization had nothing to do with it.
  53.