在 clojure 模式下,emacs 使用 5 个选项卡缩进我的分号注释。即使它是空文件中的第一行,也会发生这种情况。
例如,只需打开一个 clojure 文件,输入 ;在第一个字符处,然后按 Tab。
我使用的是 1.7.1 版
最佳答案
这是正常的行为。在您的情况下,您需要两个分号 (;;)。
来自 Good Lisp Programming Style by Peter Norvig (pdf) 上的教程-- 第 41 页:
Obey comment conventions:
- ; for inline comment
- ;; for in-function comment
- ;;; for between-function comment
- ;;;; for section header (for outline mode)
这些注释提示是为 emacs lisp 编写的,但对于所有 lisp 都是一样的:http://www.gnu.org/s/emacs/manual/html_node/elisp/Comment-Tips.html
(setq base-version-list ; there was a base
(assoc (substring fn 0 start-vn) ; version to which
file-version-assoc-list)) ; this looks like
; a subversion
;
;
;
; again,
; this is inline comment
;; two semicolon comment
;; aligned to the same level of indentation as the code
关于emacs - clojure 模式下的注释缩进似乎很困惑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4531761/