什麼是在emacs模式下定義多行註釋的正確方法 (如C的/ * * /)?我看到的elisp示例是以單個分隔符開始並在行尾結束的註釋(如C++的或Perl的#)。Emacs模式多行註釋
7
A
回答
13
是這樣的:
(define-derived-mode my-mode
awk-mode "my"
"My mode"
(setq comment-multi-line nil) ; maybe
(setq comment-start "/* ")
(setq comment-end "*/"))
但也有細微之處;也許你想
/* line one */
/* line two */
/* line three */
或者也許你想
/*
line one
line two
line three
*/
這是由您comment-style
,您可以自定義(M-x customize-variable comment-style
)的影響。對於第一個示例,選擇indent
,對於第二個示例,extra-line
。
它的全部定義在newcomment.el
,你可以閱讀關於如果你M-x describe-variable comment-start
。
3
湯姆的回答包括創建評論;如果你希望你的模式知道註釋,你需要修正語法表。
相關閱讀:
http://www.gnu.org/software/emacs/elisp/html_node/Syntax-Tables.html#Syntax-Tables
2
這是添加註釋咕到emacs模式的優秀導遊。 http://xahlee.org/emacs/elisp_comment_handling.html
相關問題
- 1. Emacs:每行一行註釋
- 2. Emacs ESS模式 - 對註釋區域進行Tabbing
- 3. Emacs設置行間距(行尾)註釋
- 4. 如何讓Emacs的sql模式識別MySQL#樣式的註釋?
- 5. 如何在emacs次要模式下設置註釋開始和註釋結束?
- 6. 多行註釋vs單行註釋
- 7. Emacs Lisp:多個註釋開始值
- 8. 在Emacs C模式下自動註釋結束花括號
- 9. Amchart註釋。從註釋模式返回正常模式
- 10. SilverStripe3:模板中的多行註釋
- 11. 多行註釋以「
- 12. PHP多行註釋
- 13. Emacs鍵入註釋選擇/多行SQL文件?
- 14. emacs編程組件。多註釋行列!= 0
- 15. 刪除C樣式多行註釋
- 16. Emacs組織模式HTML腳註
- 17. awk中的多行註釋
- 18. LESS無聲多行註釋
- 19. Groovy刪除多行註釋
- 20. 多行註釋聲明後
- 21. GCC多行註釋警告
- 22. Kivy的多行註釋
- 23. Xcode中的多行註釋
- 24. JSP:此行多註釋
- 25. PowerShell中的多行註釋
- 26. 正確JS多行註釋
- 27. 多行註釋問題jquery
- 28. 水晶多行註釋
- 29. shell腳本多行註釋
- 30. 使用QXmlStreamWriter多行註釋