From: haj@posteo.de (Harald Jörg)
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 46024@debbugs.gnu.org, "積丹尼 Dan Jacobson" <jidanni@jidanni.org>
Subject: bug#46024: Perl mode colors the word "argument" funny [PATCH]
Date: Wed, 27 Jan 2021 15:08:28 +0100 [thread overview]
Message-ID: <87v9bicw0z.fsf_-_@hajtower> (raw)
In-Reply-To: <87zh10yfyu.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 22 Jan 2021 19:38:33 +0100")
[-- Attachment #1: Type: text/plain, Size: 478 bytes --]
Lars Ingebrigtsen <larsi@gnus.org> 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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Remove non-Perl keywords --]
[-- Type: text/x-diff, Size: 1915 bytes --]
From 7fee0d96a94dfca5567efc757f5b38655e807787 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Harald=20J=C3=B6rg?= <haj@posteo.de>
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
next prev parent reply other threads:[~2021-01-27 14:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-21 20:05 bug#46024: Perl mode colors the word "argument" funny 積丹尼 Dan Jacobson
2021-01-22 0:33 ` Harald Jörg
2021-01-22 18:38 ` Lars Ingebrigtsen
2021-01-27 14:08 ` Harald Jörg [this message]
2021-01-28 3:23 ` bug#46024: Perl mode colors the word "argument" funny [PATCH] Lars Ingebrigtsen
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=87v9bicw0z.fsf_-_@hajtower \
--to=haj@posteo.de \
--cc=46024@debbugs.gnu.org \
--cc=jidanni@jidanni.org \
--cc=larsi@gnus.org \
/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.