From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "Harald Jörg" <haj@posteo.de>
Cc: 66050@debbugs.gnu.org,
Jens Schmidt <jschmidt4gnu@vodafonemail.de>,
Stefan Kangas <stefankangas@gmail.com>
Subject: bug#66050: Making perl-mode.el obsolete
Date: Sun, 24 Sep 2023 11:58:48 -0400 [thread overview]
Message-ID: <jwvo7hrbmnv.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <874jjka15f.fsf@oook.m.uunet.de> ("Harald Jörg"'s message of "Sun, 24 Sep 2023 00:02:52 +0000")
> It would need more work. An important step is to identify the features
> we should be able to switch off per customization. I am somewhat
> reluctant to add more options to cperl-mode if they can't be bundled
> (like `cperl-hairy' does): The possible combinations of options are a
> nightmare to document, to test, and also to learn for new users.
BTW, "bundling" is what Custom themes are for.
At least to solve the "learn for new users" side of the problem.
Not to say we should add more options (or more fine-grained options),
but it can be helpful to simplify the code (a.g. avoid having to test both
`cperl-dont-be-hairy` and `cperl-highlight-variables-indiscriminately`).
> Yes, that should be covered. The option name is somewhat ... weird, but
> I didn't find enough motivation to change it (or to fiddle with
> font-lock-level 3, which would be more in line with other modes).
That's a downvote for font-lock levels from me.
> This seems doable. The easy way is to make cperl-hash-face and
> cperl-array-face customizable so that they can be "downgraded" to
> font-lock-variable-name-face.
They're faces, so they are already customizable, e.g. via Custom themes.
>> 3. Variable sigils ("$", "%", "@") should not be highlighted at all.
> I doubt that this is worth the effort in cperl-mode... and guess it
> should be tolerable. The sigil *is* part of the variable, after all.
FWIW, I agree. We don't have to satisfy all the wishlist items of
previous `perl-mode` users.
>> 4. Builtins ("shift", "ref", "defined") should not be highlighted at
>> all.
> This is an area where cperl-mode is a bit untidy. It has two different
> faces for builtins, depending on whether they can be overridden by user
> functions with the same name. Many occur in two lists for
> fontification, only the first one ever applies. This has *some*
> justification because builtins allow sloppy syntax (omitting
> parentheses).
What part of this is "untidy" or "a mess"? I can see why you'd say it
w.r.t Perl having those fine distinctions, but the corresponding
features in `cperl-mode` seem to just reflect Perl's syntax&semantics.
Or is it the implementation part to distinguish those two kinds of
builtins messy?
> When we clean up this mess, adding a way to not
> highlighting them at all should not be too difficult.
AFAIK that can also be solved by changing the faces' appearance, hence
without changing the code.
>> 5. Package names should be highlighted as font-lock-constant-face rather
>> than font-lock-function-face.
>
> perl-mode uses font-lock-function-name-face in the package declaration
> but font-lock-constant-face in 'use' statements. I can't say whether
> that is intentional.
>
> Someone once suggested to use font-lock-type-face (because packages
> usually are classes, and classes are sort-of types). This is one of the
> cases where I doubt that adding more options will actually improve
> things.
I think it's more important here to choose a "meaningful/consistent"
behavior than to reproduce what was done historically in `perl-mode` or
`cperl-mode`.
>> 7. Regexps should be highlighted as font-lock-string-face.
> This can be added as an option with some effort. Regexps aren't
> strings, but alas, almost no syntax highlighter takes the same effort as
> cperl-mode to display them.
Here again, I believe it's a small matter of changing faces.
Stefan
next prev parent reply other threads:[~2023-09-24 15:58 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-17 12:47 bug#66050: Making perl-mode.el obsolete Stefan Kangas
2023-09-17 16:34 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-17 18:20 ` Stefan Kangas
2023-09-17 20:59 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-22 7:39 ` Stefan Kangas
2023-09-24 0:02 ` Harald Jörg
2023-09-24 15:58 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-09-24 21:29 ` Harald Jörg
2023-09-24 22:12 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-25 9:18 ` Harald Jörg
2023-09-25 10:09 ` Mauro Aranda
2023-09-25 10:34 ` Harald Jörg
2023-09-18 14:11 ` Corwin Brust
2023-09-20 18:34 ` Richard Stallman
2023-09-20 23:26 ` Stefan Kangas
2023-09-21 0:08 ` Corwin Brust
2023-09-21 0:16 ` Stefan Kangas
2023-09-21 0:37 ` Corwin Brust
2023-09-21 0:49 ` Stefan Kangas
2023-09-21 14:13 ` Mauro Aranda
2023-09-21 14:20 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-21 20:14 ` Mauro Aranda
2023-09-24 5:30 ` Stefan Kangas
2023-09-24 22:21 ` Harald Jörg
2023-09-24 22:40 ` Mauro Aranda
2023-09-25 8:33 ` Harald Jörg
2023-09-25 13:04 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-24 22:54 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-25 8:40 ` Harald Jörg
2023-09-18 16:14 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-24 0:44 ` Harald Jörg
2023-09-24 7:31 ` Stefan Kangas
2023-09-24 16:01 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-26 9:02 ` Richard Stallman
2023-09-23 22:13 ` Harald Jörg
2023-09-24 10:41 ` Stefan Kangas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvo7hrbmnv.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=66050@debbugs.gnu.org \
--cc=haj@posteo.de \
--cc=jschmidt4gnu@vodafonemail.de \
--cc=monnier@iro.umontreal.ca \
--cc=stefankangas@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.