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

后端 未结 4 1945
伪装坚强ぢ
伪装坚强ぢ 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:32

    As a stopgap measure, you can use C-q (quoted-insert) to insert an arbitrary character without triggering any mode-related magic. For example, in java-mode, typing parentheses reindents the current line, which is not always what I want; in such cases, I'll insert a parenthesis with C-q to preserve my indentation. (Or more often, I'll type a parenthesis, observe the indentation change, curse, undo, and re-enter with C-q.)

    For commenting in general, it would probably be easier to use M-; (comment-dwim) rather than typing the semicolons manually.

提交回复
热议问题