]> git.eshelyaron.com Git - emacs.git/commit
; cperl-mode: bugfix / rework fontification of here-docs
authorHarald Jörg <haj@posteo.de>
Mon, 23 Aug 2021 14:26:45 +0000 (16:26 +0200)
committerHarald Jörg <haj@posteo.de>
Mon, 23 Aug 2021 14:40:45 +0000 (16:40 +0200)
commit975939df214179906c9101c14e1306502b49466f
tree68823565eace5fc9a9821ca2030ebd48240c4a35
parent4167d4b4b2727ef9de5ad91228934eef11233e27
; cperl-mode: bugfix / rework fontification of here-docs

* lisp/progmodes/cperl-mode.el (cperl-mode): Use
`cperl-font-lock-syntactic-face-function'.
(cperl-commentify): Add a docstring, eliminate unused formal
parameter `noface'.
(cperl-is-here-doc-p): New function to detect whether "<<" starts
a here-document, factored out from `cperl-find-pods-heres'.
(cperl-here-doc-functions): New variable: List of functions which
allow here-documents as parameters, for use in
`cperl-is-here-doc-p'.
(cperl-process-here-doc): New function, factored out from
`cperl-find-pods-heres'.  Fixed to keep correct fontification
after non-interactive (elisp) changes (Bug#14343, Bug#28962).
(cperl-find-pods-heres): Extend the doc-string to describe all
parameters.  Don't remove text properties in recursive calls on
the same line.  Call `cperl-process-here-doc' when appropriate.
(cperl-font-lock-syntactic-face-function): New function to
highlight c-style comments as here-documents (adapted from
perl-mode.el).

* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-identify-heredoc): New test for the new function
`cperl-is-here-doc-p'.
(cperl-test-identify-no-heredoc): New test for the new function
`cperl-is-here-doc-p', testing constructs which start with "<<"
but are no here-documents.
(cperl-test-here-doc-missing-end): New test to verify correct
detection of a missing here-document delimiter.
(cperl-test-bug-14343): New test to verify that inserting text
into a here-document with elisp does not break fontification.
lisp/progmodes/cperl-mode.el
test/lisp/progmodes/cperl-mode-tests.el