emacs_defuns_find_and_replace_stuff

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



Date: Mon, 16 Oct 2000 18:09:26 -0700
From: Aaron Lehmann <aaronl@vitelus.com>
To: Greg Herlein <gherlein@herlein.com>
Cc: svlug@svlug.org
Subject: Re: [svlug] To the VI masters

On Mon, Oct 16, 2000 at 05:20:41PM -0700, Greg Herlein wrote:
> > As for me, I'm still used to Emacs Lisp programming and I reccomend
> > it: it sure beats these macros.
> 
> Do you have a macro that does the // to /* */ conversion for
> emacs?  If so, I'd love to have it!  I'll share my wimpy but
> useful for me .emacs file for it.  :)

For you, here's an Emacs defun to do the same thing:

(defun cpp-to-c
 "Replace the next C++ comment with a C comment"
  (interactive)
  (re-search-forward "//")
  (replace-match "/*")
  (end-of-line)
  (insert " */"))


Have fun :). It would be easy to modify it to change every C++ comment
in the buffer to a C comment, and I'll do that if you want. You can
stick this into your .emacs file and bind a key to it.

As for .emacs files, mine is at http://vitelus.com/aaronl/pub/conf/emacs.
It's a whimpy 23k. :(

===


the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu