Emacs缩进模板类/函数

Luc*_*ini 5 c++ emacs templates

有人知道如何禁止emacs在模板子句后缩进函数或类的名称吗?

目前的结果是:

template <typename T>
    class A {
    /* ... */
    };
Run Code Online (Sandbox Code Playgroud)

我想要的地方:

template <typename T>
class A {
/* ... */
};
Run Code Online (Sandbox Code Playgroud)

非常感谢您的帮助.

编辑1 我正在使用c ++ - 模式,java作为c ++的缩进样式.我用这种方式定制了c-offset-alist:

(custom-set-variables 
;;
'(c-offsets-alist (quote ((case-label . +) (innamespace . 0))))
Run Code Online (Sandbox Code Playgroud)

Rin*_*g Ø 8

转到该class行并点击TAB以执行(未经请求的)缩进.
然后按Control-CControl-Oto display the indent mode fortopmost-intro-cont`

ENTER,然后您可以更改缩进数字(例如3到0).

在您的最后,您.emacs可以永久设置该指令:

  (c-set-offset 'topmost-intro-cont 0 nil)
Run Code Online (Sandbox Code Playgroud)