When editing Lisp code, occasionally it's useful to entirely comment out a top-level definition, like this:
;(defun some-fn-which-is-broken (x)
; ...)
... or comment out only part of an s-expression, like this:
(foo x
; y
z)
... and then recompile the file and test something in the REPL, etc.
With paredit-mode enabled, this doesn't work. Here's what happens, if the point is right before the first paren below:
(defun some-fn (x)
...)
and you type a semicolon, what is entered is a semicolon and a newline:
;
(defun some-fn (x)
...)
Same with commenting out part of the s-expression:
(foo x
;
y
z)
I think that if the definition is all on one line, this works:
;(defparameter *foo* 10)
... but otherwise I can't find out how to do this. Paredit is great, I would really like to keep using it. Are there any Lispers who know a way around this, or Emacs-wizards who can whip up a bit of Emacs Lisp to bind to something like paredit-comment-out-s-expr
?
If there is a more Lispy or Emacsy way of accomplishing essentially the same thing, commenting out parts of source to recompile, please, don't hesitate to suggest them!