emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Minor enhancement to font-look keywords of perl-mode


From: JUAN-LEON Lahoz Garcia
Subject: Minor enhancement to font-look keywords of perl-mode
Date: Tue, 22 Mar 2005 18:01:40 +0100

Hi.

When perl-mode decides to fontify variables and functions by looking
at the syntax prefix ($ or &) in a word, it does not take into account
that maybe the variable or function can be of an external module.

So in expresions "$Foo::bar" or "&Foo:bar" only "Foo" is
fontified. This looks ackward when editing code where such programming
practices are followed.

Following patch solves this, IMHO. Maybe someone in this list can
review and/or apply it.

Regards
juanleon

--- perl-mode.el.~1.52.~        Mon Feb 28 00:13:19 2005
+++ perl-mode.el        Tue Mar 22 17:45:24 2005
@@ -207,10 +207,10 @@
     '("\\<\\(local\\|my\\)\\>" . font-lock-type-face)
     ;;
     ;; Fontify function, variable and file name references.
-    '("&\\(\\sw+\\)" 1 font-lock-function-name-face)
+    '("&\\(\\sw+\\(::\\sw+\\)*\\)" 1 font-lock-function-name-face)
     ;; Additionally underline non-scalar variables.  Maybe this is a bad idea.
     ;;'("address@hidden(\\sw+\\)" 1 font-lock-variable-name-face)
-    '("[$*]{?\\(\\sw+\\)" 1 font-lock-variable-name-face)
+    '("[$*]{?\\(\\sw+\\(::\\sw+\\)*\\)" 1 font-lock-variable-name-face)
     '("\\(address@hidden|\\$#\\)\\(\\sw+\\)"
       (2 (cons font-lock-variable-name-face '(underline))))
     '("<\\(\\sw+\\)>" 1 font-lock-constant-face)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]