Comment indenting seems messed up in clojure-mode

前端 未结 1 2032
夕颜
夕颜 2021-02-07 12:45

In clojure-mode emacs is indenting my semi colon comments with 5 tabs. Even if it is the first line in an empty file this occurs.

Eg just open up a clojure file, enter

相关标签:
1条回答
  • 2021-02-07 13:09

    That's normal behavior. In your case you want two semicolons (;;).


    From Tutorial on Good Lisp Programming Style by Peter Norvig (pdf) -- page 41:

    Obey comment conventions:

    • ; for inline comment
    • ;; for in-function comment
    • ;;; for between-function comment
    • ;;;; for section header (for outline mode)

    These comment tips are written for emacs lisp, but they are the same for all lisps: 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
    
    0 讨论(0)
提交回复
热议问题