For example, if I want to comment this:
(defun noop ()
nil)
Every time I try to put a semicolon before the "(defun", the defun runs away to the next line. So how is that supposed to be done?
GNU Emacs 23.1.1
Edit: by "running away" I mean when I insert a semicolon before "(defun", a newline is automatically inserted after the semicolon and "(defun" starts on a new line again.
M-X comment-dwim
or M-;
, which is the default key binding for the former — might save you a few key strokes, since it not only comments, but uncomments region, if it's commented already. Anyway, check out Emacs Manual for a proper description.
See the command M-x comment-region and related.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With