1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-10 16:20:17 -08:00
Commit graph

5 commits

Author SHA1 Message Date
Harald Jörg
384483e263 ; cperl-mode.el: Indent labels only in code (Bug#79271)
* lisp/progmodes/cperl-mode.el (cperl-indent-line): Make sure that
labels are indented in code only

* test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts: Two
new testcases for non-indentable "labels" in a regex pattern and a
qw list
2025-08-22 12:42:00 +02:00
Harald Jörg
fdf5e5dc41 ; cperl-mode.el: fix indentation for multiline signatures
This fixes the first (and more important) part of Bug#79269.

* lisp/progmodes/cperl-mode.el (cperl-get-state): Replace
`beginning-of-defun' by `beginning-of-defun-raw'.  Also fix a typo
in the docstring.

* test/lisp/progmodes/cperl-mode-tests.el (test-indentation): Skip
tests unless in cperl-mode.  The test file cperl-indents.erts
explicitly invokes cperl-mode.  Due to different indentation
defaults the tests do not pass in perl-mode.

* test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts: Add
test cperl-subroutine-signatures for Bug#79269
2025-08-21 17:52:30 +02:00
Harald Jörg
b2f124f2a8 ; 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
2025-03-09 16:26:51 +01:00
Harald Jörg
766784f186 cperl-mode.el: Add support for new Perl syntax in Perl 5.36 and 5.38
Perl 5.38 was released on 2023-07-03.  This patch supports the new features
for 5.36 and 5.38 for font-lock, indentation, and imenu index creation.

* lisp/progmodes/cperl-mode.el (cperl-praise): Mention classes.
(defconst): Fix typo in docstring of cperl--single-attribute-rx.
Add "class" to cperl--package-rx, and adjust its docstring.
New rx sequence cperl--class-for-imenu-rx to capture classes,
use this in cperl--imenu-entries-rx.
Add "method" to cperl--sub-name-for-imenu-rx.
Add "class" to cperl--block-declaration-rx.
(cperl-sub-keywords): Add "method".
(cperl-mode): Add "ADJUST" to defun-prompt-regexp.
(cperl-after-block-p): Add new keywords for Perl 5.36 and 5.38.
(cperl-indent-exp): Add "field" to expression starters.
(cperl-imenu--create-perl-index): Rename variables refering to
"package", because they also contain classes.
(cperl-init-faces): Add new keywords for Perl 5.36 and 5.38.
(cperl-find-tags): Add support for "class".
(cperl-short-docs): Add new keywords for Perl 5.36 and 5.38.
(cperl-indent-exp): Add new keywords for Perl 5.36 and 5.38.

* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-fontify-class): New test for fontification of class
elements.
(cperl-test-imenu-index): Add tests for (nested) class
definitions.

* test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts:
Add test cases for try/catch/finally, defer, class, method

* test/lisp/progmodes/cperl-mode-resources/perl-class.pl: New
resource for fontification tests of class elements.

* test/lisp/progmodes/cperl-mode-resources/grammar.pl: Add some
classes to the test resource.
2023-07-03 23:05:10 +02:00
Lars Ingebrigtsen
711f908f5d Fix cperl list indentation problem
* lisp/progmodes/cperl-mode.el (cperl-calculate-indent): Indent
foo:bar() in lists correctly (bug#57829).
2022-09-16 13:06:23 +02:00