Subject: bug#76868: 29.4; cperl-mode __END__ is incorrectly handled

From: Harald Jörg <[email-masked]>
Date: Mon, 10 Mar 2025 00:34:59 +0000

John Ciolfi <[email-masked]> writes:

> Thanks for the detailed response. I learned something new. To me it
> seems that perl isn't supplying enough information for cperl-mode to
> get the trailers correct. Ideally, we could definitively tell the type
> of content below the __END__ or __DATA__ keywords.  I suppose one
> could set file local variables to configure
> cperl-fontify-trailer. However, one needs to know about this option. I
> wonder if there's a way to make the option more obvious?

File local variables work but need caution.  Several tools might compete
with content for the first line, and a local variables list "near the
end of the file" might come unexpected to a program reading from the
DATA file handle.  Often it is "less intrusive" to use a .dir-locals.el
file.

> A small suggestion is to update the help text or cperl-fontify-trailer
> to indicate it also changes the indent behavior.  I think the name
> cperl-trailer-type is a good name too, though updating the help text
> may be sufficient.

Improving the docstring by including the behavior of indentation is
indeed a good idea!  I'll do that for the master branch.
-- 
Cheers,
haj