all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
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 18:12:49 -0400	[thread overview]
Message-ID: <jwvcyy7b64o.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87ttrjw997.fsf@oook.m.uunet.de> ("Harald Jörg"'s message of "Sun, 24 Sep 2023 21:29:08 +0000")

>>> 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.
> Oh - I guessed that ignoring font-lock-levels was one of the things you
> meant when you wrote that cperl-mode is different than other major modes...

Levels are just not the right concept, because there are many ways to
"measure" and hence order by levels.

E.g. Most of the time, "level" is associated with the amount of effort
to figure out where to highlight, which is related to how much
understanding of the language is needed.  So it ends up providing
"lexical-level" information only at the lowest level and then as you
move up the level it gets more fancy and start accounting for grammar
and then static semantics (e.g. whether an identifier is a reference to
a local or global var).

Personally I want very little highlighting, but I'm usually more
interested in the "higher-level" highlighting, so I end up having to
choose the highest-level and then configuring most faces to be
indistinguishable from `default` :-(

> Sure.  I think that creating custom themes might be a bit beyond what
> *users* of c?perl-mode might want to do (I myself never did that).

I'm not talking about users creating a custom theme.  I'm talking about
cperl-mode providing a custom theme that gets it closer to something
like `perl-mode`.

> Emacs comes with themes which look better than anything I could create -

A cutom theme is nothing more than a set of Custom settings (vars and
faces), and users can enable *several* themes at the same time.  So we
can provide a `perl-mode` theme which just changes `cperl-mode` to look
and behave somewhat like `perl-mode` and that doesn't prevent users from
*also* using `modus-vivendi` or whichever "global color theme" they like.

A "custom theme" is like a minor mode, except that it's more declarative
so it better interacts with other user settings (or other themes which
may partly overlap).

> An overhaul of all of this would take some time, and probably a thick
> skin to weather the storm caused by cperl-mode users who are
> accustomed to the current colors.

I think you're overly pessimistic.  A few tweaks here and there
shouldn't cause too much noise, if they make things more
regular/consistent.

> It is a bit more than _changing_ faces.  In the match part, cperl-mode
> highlights metacharacters (|) as keywords, [] as functions, and
> character classes (\d \D \s and friends) as types.

I guess using `font-lock-function-name-face` for [] does sound quite
wrong, since it plays a very different role from "the place where an
identifier is defined as a function-like thingy", which is what this
face is typically used for elsewhere.
I'd recommend to highlight them as something like keywords as well.
[ BTW, ELisp mode uses `font-lock-regexp-grouping-construct` for some
  of that.  ]

"Types" also sounds odd for \d and friends but the harm is probably
a bit more mild.

> The substitution part can be actual Perl code, and cperl-mode will
> fontify it as Perl code.

IIRC `perl-mode` also tries to fontify the replacement part as Perl code
(when it does contain Perl code).  I can't remember if I managed to make
it work for all the relevant cases, but I haven't heard any complaint
from `perl-mode` users when I made this change, so if `cperl-mode` does
it in more cases, I don't think `perl-mode` users will complain when
switching to `cperl-mode`.


        Stefan






  reply	other threads:[~2023-09-24 22:12 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
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 [this message]
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=jwvcyy7b64o.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.