GNU bug report logs - #27613
[PATCH] Support all perl variable declarators and prefixes

Previous Next

Package: emacs;

Reported by: Jefferson Carpenter <jeffersoncarpenter2 <at> gmail.com>

Date: Fri, 7 Jul 2017 22:30:02 UTC

Severity: minor

Tags: fixed, patch

Merged with 21988

Found in version 24.5

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jefferson Carpenter <jeffersoncarpenter2 <at> gmail.com>
To: 27613 <at> debbugs.gnu.org
Cc: Jefferson Carpenter <jeffersoncarpenter2 <at> gmail.com>
Subject: bug#27613: [PATCH] Support all perl variable declarators and prefixes
Date: Fri,  7 Jul 2017 17:08:52 -0500
Syntax highlight declarators and prefixes, and add all variable
definitions to imenu.
---
 lisp/progmodes/perl-mode.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 3def37a2ea..9cacfac336 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -135,7 +135,7 @@
   '(;; Functions
     (nil "^[ \t]*sub\\s-+\\([-[:alnum:]+_:]+\\)" 1)
     ;;Variables
-    ("Variables" "^\\(?:my\\|our\\)\\s-+\\([$@%][-[:alnum:]+_:]+\\)\\s-*=" 1)
+    ("Variables" "^[ \t]*\\(?:anon\\|argument\\|has\\|local\\|my\\|our\\|state\\|supersede\\)\\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'.")
@@ -179,8 +179,9 @@
                             "BEGIN" "END" "return" "exec" "eval") t)
               "\\>")
      ;;
-     ;; Fontify local and my keywords as types.
-     ("\\<\\(local\\|my\\)\\>" . font-lock-type-face)
+     ;; 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
      ;;
      ;; Fontify function, variable and file name references.
      ("&\\(\\sw+\\(::\\sw+\\)*\\)" 1 font-lock-function-name-face)
-- 
2.11.0





This bug report was last modified 7 years and 65 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.