From: Harald Jörg Date: Sun, 9 Mar 2025 15:26:51 +0000 (+0100) Subject: ; cperl-mode.el: Don't misinterpret exec_fcn as keyword exec X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=926b2f4eea11b0504587a03d57449b9fffe2e906;p=emacs.git ; cperl-mode.el: Don't misinterpret exec_fcn as keyword exec * 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) --- diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 496c951d087..d7adbff325c 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -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\\)\\_>"))))))) (defun cperl-indent-exp () diff --git a/test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts b/test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts index ba35b1d0690..ab00e9ce6d4 100644 --- a/test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts +++ b/test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts @@ -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; +=-=-=