Xref: utzoo gnu.emacs.help:984 comp.emacs:9945 Path: utzoo!utgpu!watserv1!watmath!uunet!tut.cis.ohio-state.edu!ATHENA.MIT.EDU!bjaspan From: bjaspan@ATHENA.MIT.EDU ("Barr3y Jaspan") Newsgroups: gnu.emacs.help,comp.emacs Subject: Re: Block Comment Macros. Message-ID: <9101280007.AA15951@steve-dallas.MIT.EDU> Date: 28 Jan 91 00:07:29 GMT Sender: daemon@tut.cis.ohio-state.edu Followup-To: gnu.emacs.help Organization: Gatewayed from the GNU Project mailing list help-gnu-emacs@prep.ai.mit.edu Lines: 26 Date: 21 Jan 91 22:56:09 GMT From: usc!samsung!cg-atla!kincaid@elroy.jpl.nasa.gov (Tom Kincaid ) Does anybody have a good block comment macro for gnu emacs. I'm not entirely sure what you are asking about, but I just wrote this function a few days ago (after two years of saying "gee, I really ought to write a function that does this..."). Note that if the region ends on the beginning of a line, only lines up to the PREVIOUS line are indented. This is usually what I meant; of course, you can take that part out. Barr3y Jaspan, bjaspan@mit.edu (defun highlight-region (string) "Inserts STRING at the beginning of every line in the region." (interactive "sString to insert: ") (save-excursion (if (bolp) (forward-line -1)) (save-restriction (narrow-to-region (point) (mark)) (goto-char (point-min)) (replace-regexp "^" string))))