[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#66161: cperl-mode: fontification after __END__
From: |
Harald Jörg |
Subject: |
bug#66161: cperl-mode: fontification after __END__ |
Date: |
Fri, 29 Sep 2023 16:12:31 +0000 |
CPerl mode fontifies Text after __END__ (and also after a __DATA__
token) like Perl - and I guess that this is intentional, supporting two
use cases of such text:
- The AutoSplit and SelfLoader modules (both available in the Perl
core) compile Perl sources written after these tokens only on demand
(when they're first called). For sources using these modules,
treating these texts as Perl code is useful. However, these days
both modules are rarely used in new code.
- The POD (Perl's documentation format) tools ignore the tokens, so
many authors put their documentation after an __END__ token to speed
up compilation.
For all other uses of the tokens (e.g. as a delimiter for end-of-file
comments), the fontification of CPerl mode looks messed up. So I agree
that finding a way to make these texts less "colorful" makes sense.
perl-mode treats text after these tokens as a "c-style comment". This
is elegant, but I would not want to apply this unconditionally to
cperl-mode: comments are excluded from imenu indexing, which cperl-mode
performs for both subroutines and POD headings.
--
Cheers,
haj