From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Harald =?UTF-8?Q?J=C3=B6rg?= Newsgroups: gmane.emacs.bugs Subject: bug#66050: Making perl-mode.el obsolete Date: Mon, 25 Sep 2023 09:18:26 +0000 Message-ID: <87lecur4pp.fsf@oook.m.uunet.de> References: <87il88vjvd.fsf@sappc2.fritz.box> <87fs3cv7mg.fsf@sappc2.fritz.box> <874jjka15f.fsf@oook.m.uunet.de> <87ttrjw997.fsf@oook.m.uunet.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14306"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66050@debbugs.gnu.org, Jens Schmidt , Stefan Kangas To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 25 11:20:08 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkhl9-0003Z7-Sd for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Sep 2023 11:20:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkhku-0005x7-9z; Mon, 25 Sep 2023 05:19:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qkhks-0005vv-D3 for bug-gnu-emacs@gnu.org; Mon, 25 Sep 2023 05:19:50 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkhks-0005UU-11 for bug-gnu-emacs@gnu.org; Mon, 25 Sep 2023 05:19:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qkhl4-0008GE-9s for bug-gnu-emacs@gnu.org; Mon, 25 Sep 2023 05:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Harald =?UTF-8?Q?J=C3=B6rg?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Sep 2023 09:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66050 X-GNU-PR-Package: emacs Original-Received: via spool by 66050-submit@debbugs.gnu.org id=B66050.169563354331685 (code B ref 66050); Mon, 25 Sep 2023 09:20:02 +0000 Original-Received: (at 66050) by debbugs.gnu.org; 25 Sep 2023 09:19:03 +0000 Original-Received: from localhost ([127.0.0.1]:44188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkhk6-0008Ey-Di for submit@debbugs.gnu.org; Mon, 25 Sep 2023 05:19:03 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:50213) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkhjq-0008E8-Ce for 66050@debbugs.gnu.org; Mon, 25 Sep 2023 05:19:01 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A9625240029 for <66050@debbugs.gnu.org>; Mon, 25 Sep 2023 11:18:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1695633507; bh=LPBiqyAjTXpocIpl+vRaXfHWbdira8ZtmACbPyHVr/8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=qJrldcb4ns5Lv6/DHlQ1hC5C4TXjm0/M8I1mcQ8VfHZ6cP/Gtmy9+878jkIzkBY5m bLAmyRz8CVhTF6RpnF6mnAZkeLAXD+WMhYzfaBLayFUNIN6TVQd/AJK4u8zEXsLcvV 7wLxXAfg49X1F8KKMk+E3nvaifDmanq6I2SdEBho0Y8MQyc32f4ofYOZSvHiJLxm6R kmIkZ7yEbUMQClhWQUP+Hs0UBNx5XbZDSN4oo0VTLQZQBL9WweU+rfXX30IxGiX0nv Wc9FTaDa63TMN7Xh8+c/X45IQ39Yoyeaba13JA76OSTV6worDmHvBYHUDVHtpWLiDJ 8v8LUTmnP5blw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RvHNf57gVz6tw5; Mon, 25 Sep 2023 11:18:26 +0200 (CEST) In-Reply-To: (Stefan Monnier's message of "Sun, 24 Sep 2023 18:12:49 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:271313 Archived-At: Stefan Monnier writes: >>>> 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. Oh, i see. And I agree. > [...] >> 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`. Ah - I understand. Indeed, this looks like the way to go! > [...] >> 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. ...and also I have a thick skin, so this won't stop me :) >> 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. Yes, that's not a "correct" use of `font-lock-function-name-face` - but it has been like this for ages. I think it makes sense to highlight *all* characters which aren't taken literally in the search pattern since this is a frequent source of beginner problems. > 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. ] So this would be a general improvement for cperl-mode! > "Types" also sounds odd for \d and friends but the harm is probably > a bit more mild. I find it actually defendable. Within the realm of the regular expressions language, "digits" or "spaces" are sort of "types" (and there's no dedicated font-lock-regexp-* face for those). >> 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). ... Oh - I couldn't see it with my example. Perhaps I miss a setting. > ... 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`. I agree. -- Cheers, haj