【发布时间】:2019-11-14 10:10:06
【问题描述】:
从 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 的自定义组,但我找不到一种方法来制作我想要的东西。 这是我想做的:
my @toto = qw(
toto
tutu
);
my @tutu = qw[
tata
titi
];
use constant CR => qw(
87800
76400
80200
81000
);
任何人有想法或 Elisp 黑客来做到这一点?
感谢您的帮助:)
【问题讨论】:
-
感谢您报告此事。对于第一行带有(例如最后一个
use constant CR => qw( ...,如果光标位于带有87800 的第一行,当您按下<tab>时cperl-mode将检查上面行的缩进,如line #3092 所示源代码。请注意,此行上的(current-column)将给出上行的缩进位置(qw(中(之后的位置,由于第 3089 行的goto。我会进一步尝试明白为什么会这样...... -
...我也同意你的观点,你建议的缩进看起来好多了:)
-
我添加了一个pull request,你能看看它是否适合你吗?
标签: perl emacs indentation cperl-mode