From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: haj@posteo.de (Harald =?UTF-8?Q?J=C3=B6rg?=) Newsgroups: gmane.emacs.bugs Subject: bug#46024: Perl mode colors the word "argument" funny [PATCH] Date: Wed, 27 Jan 2021 15:08:28 +0100 Message-ID: <87v9bicw0z.fsf_-_@hajtower> References: <87ft2uvyww.5.fsf@jidanni.org> <87pn1xu7ws.fsf@hajtower> <87zh10yfyu.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25219"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 46024@debbugs.gnu.org, =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 27 15:09:25 2021 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 1l4lVa-0006LE-6f for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Jan 2021 15:09:22 +0100 Original-Received: from localhost ([::1]:47968 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4lVY-0000eN-RO for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Jan 2021 09:09:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4lVG-0000eB-UZ for bug-gnu-emacs@gnu.org; Wed, 27 Jan 2021 09:09:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60761) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l4lVG-0008CP-Ew for bug-gnu-emacs@gnu.org; Wed, 27 Jan 2021 09:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l4lVG-0005CS-7X for bug-gnu-emacs@gnu.org; Wed, 27 Jan 2021 09:09:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: haj@posteo.de (Harald =?UTF-8?Q?J=C3=B6rg?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Jan 2021 14:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46024 X-GNU-PR-Package: emacs Original-Received: via spool by 46024-submit@debbugs.gnu.org id=B46024.161175651919955 (code B ref 46024); Wed, 27 Jan 2021 14:09:02 +0000 Original-Received: (at 46024) by debbugs.gnu.org; 27 Jan 2021 14:08:39 +0000 Original-Received: from localhost ([127.0.0.1]:44074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4lUt-0005Bn-Gi for submit@debbugs.gnu.org; Wed, 27 Jan 2021 09:08:39 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:58875) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4lUr-0005BW-6M for 46024@debbugs.gnu.org; Wed, 27 Jan 2021 09:08:38 -0500 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 4F98A2400FD for <46024@debbugs.gnu.org>; Wed, 27 Jan 2021 15:08:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1611756510; bh=k/cwFQAtt52Fr91UiUHrIBS5VV6C0KpH8+5snHpStH0=; h=From:To:Cc:Subject:Date:From; b=lV4aUyY4NDXSSeX3owGvqYCg294U7mrj6YSWBTkFtNu+JB8fUebt2+How2qQXyuA9 wXCQNQcD6UetnvdRvRFDMZ+UiU20I28RejSQr21MqNEKKnOvlt9W6bcyPZO7a7cy0g SCwp2t3TLfPCpAMb2YNLy+G4QvToa5w0aswAtP3+XFdouWHFh6hv95t1Tau5o69oHX upZrTyUoZJYeYl0fgeGp6WJejQkpB1bvIhiOqS2hVn/97eNmcDQ8T3R8e3Pz5tY2Ef TRlkD4e/suFAUTR1tDyLjr0qJrgIRHJXfnmRcrycgG2OwwAh9uVHruLJFk2zKiGO4P aO77jzx7wrz1A== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4DQlnT1C40z6tmF; Wed, 27 Jan 2021 15:08:28 +0100 (CET) In-Reply-To: <87zh10yfyu.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 22 Jan 2021 19:38:33 +0100") 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:198694 Archived-At: --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > [...] > Long term, it does seem like the best solution would be to have a > separate mode for Raku, and not keep tweaking (c)perl-mode to add Raku > features, I think. > > So backing out this change ('argument' etc) sounds like a good idea to > me. The attached patch removes the declarators and prefixes which are not in Perl. BTW: There is a Raku mode, maintained by the Raku team in their repository on GitHub. -- Cheers, haj --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-perl-mode.el-Eliminate-keywords-which-are-not-in-Per.patch Content-Description: Remove non-Perl keywords >From 7fee0d96a94dfca5567efc757f5b38655e807787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20J=C3=B6rg?= Date: Wed, 27 Jan 2021 14:50:01 +0100 Subject: [PATCH] ; perl-mode.el: Eliminate keywords which are not in Perl. * lisp/progmodes/perl-mode.el (perl-imenu-generic-expression): Remove keywords which are not part of Perl. (perl-font-lock-keywords-2): Remove keywords which are not part of Perl. --- lisp/progmodes/perl-mode.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index d047dd543c..0120e4a7cd 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -143,7 +143,7 @@ perl-imenu-generic-expression '(;; Functions (nil "^[ \t]*sub\\s-+\\([-[:alnum:]+_:]+\\)" 1) ;;Variables - ("Variables" "^[ \t]*\\(?:anon\\|argument\\|has\\|local\\|my\\|our\\|state\\|supersede\\)\\s-+\\([$@%][-[:alnum:]+_:]+\\)\\s-*=" 1) + ("Variables" "^[ \t]*\\(?:has\\|local\\|my\\|our\\|state\\)\\s-+\\([$@%][-[:alnum:]+_:]+\\)\\s-*=" 1) ("Packages" "^[ \t]*package\\s-+\\([-[:alnum:]+_:]+\\);" 1) ("Doc sections" "^=head[0-9][ \t]+\\(.*\\)" 1)) "Imenu generic expression for Perl mode. See `imenu-generic-expression'.") @@ -188,9 +188,8 @@ perl-font-lock-keywords-2 "\\>") ;; ;; Fontify declarators and prefixes as types. - ("\\<\\(anon\\|argument\\|has\\|local\\|my\\|our\\|state\\|supersede\\)\\>" . font-lock-type-face) ; declarators - ("\\<\\(let\\|temp\\)\\>" . font-lock-type-face) ; prefixes - ;; + ("\\<\\(has\\|local\\|my\\|our\\|state\\)\\>" . font-lock-type-face) ; declarators + ;; ;; Fontify function, variable and file name references. ("&\\(\\sw+\\(::\\sw+\\)*\\)" 1 font-lock-function-name-face) ;; Additionally fontify non-scalar variables. `perl-non-scalar-variable' -- 2.20.1 --=-=-=--