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