带有qw关键字的Emacs缩进问题

问题描述 投票:1回答:1

我从jrockway的cperl-mode存储库的最后一次提交中以cperl-mode 6.2在Windows上运行Emacs 26.3。

我对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的customize-group,但是找不到找到所需方法的方法。这是我想做的事情:

my @toto = qw(
    toto
    tutu
);

my @tutu = qw[
    tata
    titi
];

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

任何人都有想法或Elisp黑客可以做到这一点?

谢谢您的帮助:)

perl emacs indentation cperl-mode
1个回答
0
投票

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

my @tutu = qw[
    tata
    titi
    ];
© www.soinside.com 2019 - 2024. All rights reserved.