From 926b2f4eea11b0504587a03d57449b9fffe2e906 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Harald=20J=C3=B6rg?= Date: Sun, 9 Mar 2025 16:26:51 +0100 Subject: [PATCH] ; 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) --- lisp/progmodes/cperl-mode.el | 2 +- .../cperl-mode-resources/cperl-indents.erts | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) 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; +=-=-= -- 2.39.5