help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: one key-press to comment out lines of code?


From: Dale Snell
Subject: Re: one key-press to comment out lines of code?
Date: Wed, 30 Apr 2014 09:27:49 -0700

On Wed, 30 Apr 2014 17:14:03 +0100
Sharon Kimble <boudiccas@skimble.plus.com> wrote:

> Whilst I'm still learning emacs and gnus I'm constantly adding code
> to my "setup-testbed.el" file, and then finding later that it doesn't
> do what its expected to do, or I don't like the outcome, so I then
> comment it out. Currently, I'm doing it laboriously by hand, but is
> it possible to highlight it and then with one key-press insert ";" in
> front of each and every line of the code please?
> 
> I haven't seen this ability anywhere, but being able to do it would
> make things a whole lot easier for me, so, can it be done please
> folks?

Well, it's not precisely one keypress, but here's what I do:

Set point and mark to define the region.  Then do

    C-x r t RET ; SPC RET

That should do it.  If you don't like the space, you can leave it
out.  I like a little whitespace between my comment symbols and
the program text.

Hope this helps.

--Dale

--
"Text processing has made it possible to right-justify any idea, even
one which cannot be justified on any other grounds."
                -- J. Finnegan, USC.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]