From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#22867: cperl-mode: Commit d0ad6306 suppresses fontification of hash/array declarations Date: Fri, 04 Sep 2020 05:46:03 +0200 Message-ID: <87a6y6fblw.fsf@gnus.org> References: <87ziui3d2f.fsf@jidanni.org> <793881bc-c77d-8ddd-61b2-d20d94107eed@posteo.de> <1738df57-6707-a08d-80a2-c581808dbaef@posteo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10115"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Stefan Kangas , 22867@debbugs.gnu.org To: Harald =?UTF-8?Q?J=C3=B6rg?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 04 05:47:10 2020 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 1kE2gv-0002Wj-PI for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 04 Sep 2020 05:47:09 +0200 Original-Received: from localhost ([::1]:56904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kE2gu-00025z-GD for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 03 Sep 2020 23:47:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kE2go-00025e-Kh for bug-gnu-emacs@gnu.org; Thu, 03 Sep 2020 23:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53471) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kE2go-0004qM-AM for bug-gnu-emacs@gnu.org; Thu, 03 Sep 2020 23:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kE2go-0004BS-8t for bug-gnu-emacs@gnu.org; Thu, 03 Sep 2020 23:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Sep 2020 03:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22867 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 22867-submit@debbugs.gnu.org id=B22867.159919117916031 (code B ref 22867); Fri, 04 Sep 2020 03:47:02 +0000 Original-Received: (at 22867) by debbugs.gnu.org; 4 Sep 2020 03:46:19 +0000 Original-Received: from localhost ([127.0.0.1]:36784 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kE2g6-0004AV-Oa for submit@debbugs.gnu.org; Thu, 03 Sep 2020 23:46:18 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:43280) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kE2g5-0004AH-H6 for 22867@debbugs.gnu.org; Thu, 03 Sep 2020 23:46:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=IR/cHWracqe8SiDN0uE3PebpxAhKRi61TFzjOsAlFWU=; b=pfgPa5wcoXJcYZvHfoJlhw6fSn boaaXp5eUl8whWNvSfP58yv/Sa2DD3LspWGmGtjQr6y98+F/j3McDDm/aaDXo66004CE6yyPTioLP cJ3oOAHe2ESnHh5aB6sqgTfQilWjac4v42/X960IF5jt2XR3vi0ap7h7e0pBeee2Mlgs=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kE2fs-00028W-MZ; Fri, 04 Sep 2020 05:46:10 +0200 X-Now-Playing: Machinedrum's _Vapor City Citizenship Programme_: "U Still Lie" In-Reply-To: <1738df57-6707-a08d-80a2-c581808dbaef@posteo.de> ("Harald =?UTF-8?Q?J=C3=B6rg?="'s message of "Tue, 1 Sep 2020 21:44:02 +0200") 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" Xref: news.gmane.io gmane.emacs.bugs:187071 Archived-At: Harald J=C3=B6rg writes: >> Is the fix worse than the problem? If yes, maybe it should be reverted? > > The fix isn't _worse_. Strings like "%s" and "%d" in the argument > list of printf being fontified as hashes is indeed idiotic. Also, > more than once I was annoyed by fontification in POD sections. The change in the offending commit just ensured that we don't re-fontify already-fontified stuff as hashes. This means that the reason stuff like "my %foo =3D ..." isn't fontified as a hash is because something has already fontified it as something else, so I wondered whether just flipping the order of some of these regexp would do the trick. After poking around a bit, I came up with this patch: diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 5dee5007e2..7a1c2e4d24 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -5776,8 +5776,8 @@ cperl-init-faces t-font-lock-keywords) cperl-font-lock-keywords cperl-font-lock-keywords-1 cperl-font-lock-keywords-2 (append - cperl-font-lock-keywords-1 - t-font-lock-keywords-1))) + t-font-lock-keywords-1 + cperl-font-lock-keywords-1))) (if (fboundp 'ps-print-buffer) (cperl-ps-print-init)) (if (or (featurep 'choose-color) (featurep 'font-lock-extra)) (eval ; Avoid a warning It seems to fix all the test cases in Harald's .pl file, and the cperl test file still passes (but its coverage isn't, ahem, extensive). Does anybody see any problems with just doing fixing it like this? I had a peek at a couple of other perl files here, and nothing immediately looked wonky, but I'm a bit out of practice writing perl... --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no