Emacs中功能的评论 [英] Comments for Function in Emacs
问题描述
我正在寻找一种在Emacs(在任何模式下)生成并插入我的函数上的标题注释块的方式,并且基于函数的签名自动注释注释的默认内容(即正确数量的@param位置持有人)。
Doxymacs是一个不错的候选人。但是我更喜欢另一种方式,没有必要的libs。任何人都可以推荐其他方法为Emacs中的功能添加智能注释吗?谢谢。
编辑:
现在我发现这个:
I'm looking for a way to generate and insert header comment blocks above my functions in Emacs (in any mode), with the default contents of the comment automatically based on the function's signature (i.e. the correct number of @param place-holders).
Doxymacs is a nice candidate. But I prefer another way works without the necessary libs. Can anyone recommend some others ways for adding smart comments for functions in Emacs? Thanks.
Edit: Now I found this: http://nschum.de/src/emacs/doc-mode/, but it seems that it does not work well after I require it into my .emacs and add hook for js-mode. Doesn't it support js functions ?
I don't know of any general-purpose approach.
Csharp-mode has a defun that is bound to / , which tries to generate comments appropriate for C#. The way it works: Every time you type a slash, it looks to see if it is the third slash in a row. (In C#, three slashes are used to denote comments that produce documentation). If it is the third slash, then it looks at the surrounding text and inserts a comment skeleton or fragment that is appropriate.
It is not generalized in any way to support javascript or other language syntaxes. But you might be able to build what you want, if you start with that.
here's the excerpt:
这篇关于Emacs中功能的评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!