Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bloom-beacon!usc!merlin.usc.edu!aludra.usc.edu!raulmill From: raulmill@aludra.usc.edu (Raul) Newsgroups: gnu.emacs Subject: Re: Reverse-video-region, and end-of-line markers Summary: Why would someone want to skin a cat? Keywords: end-of-line indicator Message-ID: <4000@merlin.usc.edu> Date: 5 Jun 89 00:10:32 GMT Expires: 4 Jul 89 07:00:00 GMT References: <16573@sequent.UUCP> Sender: news@merlin.usc.edu Reply-To: raulmill@usc.edu (Raul) Followup-To: gnu.emacs Distribution: usa Organization: re-posters anonymous Lines: 28 - 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: (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 |