Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!bloom-beacon!usc!merlin.usc.edu!news From: news@merlin.usc.edu (USENET News) Newsgroups: gnu.emacs Subject: Re: Reverse-video-region, and end-of-line markers Summary: why would somebody want to skin a cat? Keywords: end-of-line indicator, Message-ID: <3999@merlin.usc.edu> Date: 4 Jun 89 23:28:09 GMT Expires: 4 Jul 89 07:00:00 GMT References: <16573@sequent.UUCP> Reply-To: raulmill@usc.edu (Raul) Followup-To: gnu.emacs Distribution: usa Organization: Not if I can help it! Lines: 29 - 2. Second, I've seen a feature in vi (UNIX editor) which allows you - can see exactly where the end-of-line is. It places '$' where the end - is. This is useful when you suspect that you have trailing white - space in your file (which is a pet peeve of mine to remove, and - sometimes it's meaningful to some bizarre languages such as macro - inputs to cpp for example). - - Anybody know how you can do this in emacs ?? Why not just go to the top of your file, and use replace-regexp to delete all white space at the end of a line. With standard keyboard bindings, you could do: ESC < ESC % \ s SPC + $ RET RET ! If you do this a lot, you could write a little routine to do this: From: raulmill@aludra.usc.edu (Raul) Path: aludra.usc.edu!raulmill (defun remove-trailing-whitespace-buffer () "remove irrelevant whitespace" (interactive) (save-excursion (goto-char (point-min)) (replace-regexp "\\s +$" "" nil))) And, if you are really fanatical about this, you could put it into your write-file-hooks. A more conservative option would be to bind it to some key sequence (probably one that begins with C-c). Raul Miller | INTERNET: raulmill@usc.edu | UUCP: ...uunet!usc!raulmill | 55 mph = 82 nc U.S.SNAIL: 721 E Windsor #4, GLENDALE CA 91205 |