How do you comment out all or part of a Lisp s-exp using Paredit?

后端 未结 4 1947
伪装坚强ぢ
伪装坚强ぢ 2020-12-29 09:30

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)
;  ...)
         


        
4条回答
  •  既然无缘
    2020-12-29 09:51

    You can use C-M-SPC M-; to mark the S-expression (C-M-SPC for mark-sexp) and then comment it (M-; for comment-dwim).

    In paredit 23, just typing ; won't push anything it doesn't have to off the line. So it will do the right thing for your second example. And if you wanted to comment out z instead of y it would push only the closing delimiter to another line.

提交回复
热议问题