From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: JUAN-LEON Lahoz Garcia Newsgroups: gmane.emacs.devel Subject: Minor enhancement to font-look keywords of perl-mode Date: Tue, 22 Mar 2005 18:01:40 +0100 Message-ID: NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1111510893 18790 80.91.229.2 (22 Mar 2005 17:01:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 22 Mar 2005 17:01:33 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 22 18:01:32 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DDmkT-0002nn-N2 for ged-emacs-devel@m.gmane.org; Tue, 22 Mar 2005 18:00:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DDn1o-0000zB-8X for ged-emacs-devel@m.gmane.org; Tue, 22 Mar 2005 12:18:52 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DDmy5-0007Sb-HC for emacs-devel@gnu.org; Tue, 22 Mar 2005 12:15:03 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DDmxt-0007M6-Su for emacs-devel@gnu.org; Tue, 22 Mar 2005 12:14:54 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DDmxq-0007Id-Fw for emacs-devel@gnu.org; Tue, 22 Mar 2005 12:14:46 -0500 Original-Received: from [129.188.136.8] (helo=motgate8.mot.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DDmcp-0005Vt-Gm for emacs-devel@gnu.org; Tue, 22 Mar 2005 11:53:03 -0500 Original-Received: from il06exr03.mot.com (il06exr03.mot.com [129.188.137.133]) by motgate8.mot.com (Motorola/Motgate8) with ESMTP id j2MGtI2C013197 for ; Tue, 22 Mar 2005 09:55:18 -0700 (MST) Original-Received: from zes06exm01.madrid.ecid.cig.mot.com ([10.161.1.12]) by il06exr03.mot.com (8.13.1/8.13.0) with ESMTP id j2MGsJo0016127 for ; Tue, 22 Mar 2005 10:54:20 -0600 (CST) Original-Received: from kaliban.madrid.ecid.cig.mot.com.motorola.com (10.161.14.31 [10.161.14.31]) by zes06exm01.madrid.ecid.cig.mot.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id FGJDF45S; Tue, 22 Mar 2005 17:52:59 +0100 Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:34974 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34974 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. ;;'("[$@%*][#{]?\\(\\sw+\\)" 1 font-lock-variable-name-face) - '("[$*]{?\\(\\sw+\\)" 1 font-lock-variable-name-face) + '("[$*]{?\\(\\sw+\\(::\\sw+\\)*\\)" 1 font-lock-variable-name-face) '("\\([@%]\\|\\$#\\)\\(\\sw+\\)" (2 (cons font-lock-variable-name-face '(underline)))) '("<\\(\\sw+\\)>" 1 font-lock-constant-face)