使用Emacs php模式时双缩进


Double indent when using Emacs php-mode

我的问题是,在新行中使用花括号,我得到了额外的缩进,如下面的代码所示。

我在debian-lenny上使用emacs 22.2,我已经安装了php模式。from github

(https://github.com/ejmr/php-mode/blob/master/php-mode.el)

和my .emacs只包含键绑定(不包含缩进)

if (logical condition)
       {
             avariable 
             #COMMENT 
             if (logical condition)
                 {
                     if(condition)
                          {
                               variable
................

我已经尝试了所有php文件的PEAR模式,我已经尝试了制表符模式缩进。

请告诉我,我做错了什么?更新:

以上是默认的"GNU"缩进样式。对于标准php缩进,在.emacs

中添加以下内容

以上是默认的"GNU"缩进样式。对于标准php缩进,在.emacs

中添加以下内容

(setq c-default-style "linux" c-basic-offset)

答案在这里找到:http://www.emacswiki.org/emacs/IndentingC#toc2