评论缩进似乎在clojure模式搞乱了 [英] Comment indenting seems messed up in clojure-mode

查看:176
本文介绍了评论缩进似乎在clojure模式搞乱了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在clojure模式emacs缩进我的半冒号注释5选项卡。即使它是空文件中的第一行,也会发生这种情况。



例如,打开一个clojure文件,输入;

解决方案



/ div>

这是正常的行为。在您的情况下,您需要两个分号(;;)。






良好的Lisp编程风格by Peter Norvig(pdf) - 第41页:


遵守注释约定:




  • for inline comment

  • ;;

  • ;;;用于函数间注释

  • ;;;;

这些注释提示是为emacs lisp编写的,但它们对于所有语句都是相同的: http://www.gnu.org/s /emacs/manual/html_node/elisp/Comment-Tips.html

 (setq base-version-list;有一个基础
(assoc(substring fn 0 start-vn);版本
file-version-assoc-list));这看起来像
;一个subversion
;
;
;
;再次,
;这是内联注释


;;两个分号注释
;;对齐到与代码相同的缩进水平


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 ; at the first character and press tab.

I'm using version 1.7.1

解决方案

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

这篇关于评论缩进似乎在clojure模式搞乱了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆