perl - 为什么 emacs 在散列中的数组之后奇怪地对齐?

标签 perl emacs indentation

如果我让 emacs 24.1.1 缩进以下内容

$config = {
    b  => [
           "123",
           ],
    c => "123",
    };

然后它将把它变成

$config = {
    b  => [
           "123",
           ],
        c => "123",
    };

问题

为什么它不缩进以使 bc 对齐?

更新

Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption                                   
File-Name-Shadow Font-Lock Global-Font-Lock Line-Number Menu-Bar                                         
Transient-Mark                                                                                           

(Information about these minor modes follows the major mode info.)

Perl mode defined in `perl-mode.el':
Major mode for editing Perl code.

最佳答案

因为缩进算法不理解这种情况。

我刚刚安装了 perl-mode.el 的补丁(在 Emacs 的主干中,即不会出现在即将推出的 Emacs-24.4 中,而只会出现在 Emacs-24.5 中),这似乎可以修复它。您可以在 http://bzr.savannah.gnu.org/lh/emacs/trunk/annotate/head:/lisp/progmodes/perl-mode.el 尝试新代码.

关于perl - 为什么 emacs 在散列中的数组之后奇怪地对齐?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24632654/

相关文章:

perl - Perl 是弱类型还是强类型?

linux - 如何编辑@INC 条目以包含模块的新目录

perl - Perl 方法属性如何工作?

Perl:文件大于 2 GB 的 glob 的奇怪行为

windows - 我可以让 emacs grep windows 只使用另一个窗口打开文件吗?

c++ - Visual Studio 中特定于 Qt 的构造的损坏缩进

macos - Emacs 中的 Vim

Emacs cperl-mode make if 更符合人体工学

python - 有人可以告诉我为什么我会收到意外的缩进错误吗?

python - 赋值前引用的局部变量 'fight_run'