GNU bug report logs -
#76868
29.4; cperl-mode __END__ is incorrectly handled
Previous Next
Full log
Message #14 received at 76868 <at> debbugs.gnu.org (full text, mbox):
On 8/3/25 23:59, John Ciolfi wrote:
> Yes, setting cperl-fontify-trailer to comment fixes the bug. In my
> case, the lines after the __END__ are more than just comments and get
> corrupted when they are indented. There is also the __DATA__ keyword
> and the default setting of cperl-fontify-trailier causes the data to
> be indented which alters the behavior of the program (corrupts the
> result). Consider:
>
> while (my $line = <DATA>) { print $line; } close DATA; __DATA__ This
> is not perl code
>
> If you indent, C-x h followed by C-M-\, the results change. Indenting
> shouldn't change results.
>
> Could you consider changing the default value of cperl-fontify-trailer
> to comment so that cperl-mode doesn't indent them? Also, the name is a
> little misleading because the more important piece is whether to
> semantically treat the lines after these keywords as perl code. The
> Perl interpreter never treats these as perl code, so it's odd
> cperl-mode treats them as perl code. The only case I'm aware of where
> the lines following these keywords is perl is to use the trick to put
> __END__ to comment out the bottom part of a perl program, but even in
> that case, it should be colored as comments.
>
> Thanks
>
CCing Harald.
This bug report was last modified 102 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.