Emacs 缩进问题与 qw 关键字

Emacs indent issue with qw keyword

我在 windows 上安装了 Emacs 26.3 运行,cperl-mode 6.2 来自 jrockway 的 cperl-mode 存储库的最后一次提交。

我有以下 Emacs 配置:

(setq-default tab-width 4)
(setq-default indent-tabs-mode nil)
(setq cperl-indent-level 4)
(setq cperl-indent-parens-as-block t)
(setq cperl-close-paren-offset -4)
(setq cperl-continued-statement-offset 4)
(setq cperl-tab-always-indent t)
(setq cperl-fix-hanging-brace-when-indent t)
(setq cperl-indent-subs-specially nil)

当我用 qw() 初始化一个数组时,它给出了以下内容:

my @toto = qw(
                 toto
                 tutu
         );

my @tutu = qw[
                 tata
                 titi
         ];

use constant CR => qw(
                         87800
                         76400
                         80200
                         81000
                 );

这不是我的准则,因为我遵循 80 个字符的规则... 我不知道这是正常行为还是错误。 我尝试了多种配置,查看了 cperl 的自定义组,但我找不到制作我想要的东西的方法。 这是我想做的事情:

my @toto = qw(
    toto
    tutu
);

my @tutu = qw[
    tata
    titi
];

use constant CR => qw(
    87800
    76400
    80200
    81000
);

有人有想法或 Elisp hack 来做到这一点吗?

感谢您的帮助:)

我刚刚向 Emacs 的 master 分支推送了一个补丁,以修复 perl-modeqw 的缩进。
它现在几乎可以像您想要的那样工作(右括号除外)。例如:

my @tutu = qw[
    tata
    titi
    ];

由来自@HåkonHægland 的 https://github.com/jrockway/cperl-mode/pull/54 解决。