Emacs cperl - indentation in constant block

有些话、适合烂在心里 提交于 2019-12-05 06:29:19

A bit of digging in the code suggests this is a bug in cperl-mode - it should be treating a constant block like an anonymous hashref - after all, that's basically what it is! Here's a patch to cperl-block-p that makes it so. Would anyone care to approve or reject this? My elisp is a bit rusty :-)

$ diff -u cperl-mode.el.orig cperl-mode.el
--- cperl-mode.el.orig  2013-09-27 13:43:56.000000000 +0100
+++ cperl-mode.el   2014-06-30 18:02:30.000000000 +0100
@@ -4828,9 +4828,9 @@
       (and (memq (char-syntax (preceding-char)) '(?w ?_))
       (progn
         (backward-sexp)
-        ;; sub {BLK}, print {BLK} $data, but NOT `bless', `return', `tr'
+        ;; sub {BLK}, print {BLK} $data, but NOT `bless', `constant', `return', `tr'
         (or (and (looking-at "[a-zA-Z0-9_:]+[ \t\n\f]*[{#]") ; Method call syntax
-             (not (looking-at "\\(bless\\|return\\|q[wqrx]?\\|tr\\|[smy]\\)\\>")))
+             (not (looking-at "\\(bless\\|constant\\|return\\|q[wqrx]?\\|tr\\|[smy]\\)\\>")))
         ;; sub bless::foo {}
         (progn
           (cperl-backward-to-noncomment (point-min))
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!