]> git.eshelyaron.com Git - emacs.git/commitdiff
; cperl-mode.el: Don't misinterpret exec_fcn as keyword exec
authorHarald Jörg <haj@posteo.de>
Sun, 9 Mar 2025 15:26:51 +0000 (16:26 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 12 Mar 2025 18:46:54 +0000 (19:46 +0100)
* lisp/progmodes/cperl-mode.el
(cperl-after-block-and-statement-beg): Recognize _ as part of a
Perl symbol.  Fixes Bug#76851

* test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts
Two new test cases around the edges of Bug#76851

(cherry picked from commit b2f124f2a8887a3bf2e68ec09500361a2d4d0850)

lisp/progmodes/cperl-mode.el
test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts

index 496c951d087a485ce5207afec9befd23e199c54d..d7adbff325c52f2561388293de119a2237596a2f 100644 (file)
@@ -5604,7 +5604,7 @@ Do not look before LIM."
           (forward-sexp -1)
           (not
            (looking-at
-            "\\(map\\|grep\\|say\\|printf?\\|system\\|exec\\|tr\\|s\\)\\>")))))))
+            "\\(map\\|grep\\|say\\|printf?\\|system\\|exec\\|tr\\|s\\)\\_>")))))))
 
 \f
 (defun cperl-indent-exp ()
index ba35b1d06904612f5aa7198cfcfc43a21d3d40d7..ab00e9ce6d42f03649b219e32a14aa3b39f0a74e 100644 (file)
@@ -79,3 +79,22 @@ class C
 
 say "done!";
 =-=-=
+
+Name: cperl-keyword-in-subname
+
+=-=
+# Bug#76851
+sub exec_fcn {
+}
+
+sub other {
+}
+=-=-=
+
+Name: cperl-keyword-without-space
+
+=-=
+# Bug#76851, message #13
+my %h = map{$_=>1}
+  @ARGV;
+=-=-=