在Emacs中缩进C块注释

dan*_*poe 6 c emacs comments

我正在尝试配置emacs以便很好地缩进我的C块注释.

Emacs(22.3)默认情况下(无论缩进样式如何):

/* My very long comment which spreads over multiple lines
* and thus needs to be filled.
*/

但我更喜欢的是:

/* My very long comment which spreads over multiple lines
 * and thus needs to be filled.
 */

我尝试使用c-offset-alist和语法符号"c",但它并没有帮助我理解这个问题:

(c-add-style "mine"
             '((c-basic-offset . 2)
               (c-block-comment-prefix . "* ")
               (c-offsets-alist
                (c . +)))
             )
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?提前致谢!

干杯,丹尼尔

sco*_*zer 3

嗯,它适用于 22.3.1,并以“-Q”选项开头,不会加载任何个人或站点 lisp 文件。抱歉帮不了什么忙,但我认为这是你的设置。尝试执行“emacs -Q”并查看是否仍然遇到相同的问题。