[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master b62a1e3: Add 'perl-non-scalar-variable' face to perl-mode
From: |
Lars Ingebrigtsen |
Subject: |
master b62a1e3: Add 'perl-non-scalar-variable' face to perl-mode |
Date: |
Tue, 19 Jan 2021 02:12:23 -0500 (EST) |
branch: master
commit b62a1e358befe996a4e2f4038ef48a9dd44901f8
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Add 'perl-non-scalar-variable' face to perl-mode
* etc/NEWS: Document the new face (bug#45840).
* lisp/progmodes/perl-mode.el (perl-non-scalar-variable): Define new
face.
(perl-font-lock-keywords-2): Apply 'perl-non-scalar-variable' face.
---
etc/NEWS | 6 ++++++
lisp/progmodes/perl-mode.el | 11 +++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index d632283..8fc5f3e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -352,6 +352,12 @@ When emacsclient connects, Emacs will (by default) output
a message
about how to exit the client frame. If 'server-client-instructions'
is set to nil, this message is inhibited.
+** Perl mode
+
+---
+*** New face 'perl-non-scalar-variable'.
+This is used to fontify non-scalar variables.
+
** Python mode
*** 'python-shell-interpreter' now defaults to python3 on systems with python3.
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 2a2a497..d047dd5 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -95,6 +95,12 @@
:prefix "perl-"
:group 'languages)
+(defface perl-non-scalar-variable
+ '((t :inherit font-lock-variable-name-face :underline t))
+ "Face used for non-scalar variables."
+ :version "28.1"
+ :group 'perl)
+
(defvar perl-mode-abbrev-table nil
"Abbrev table in use in perl-mode buffers.")
(define-abbrev-table 'perl-mode-abbrev-table ())
@@ -187,11 +193,12 @@
;;
;; Fontify function, variable and file name references.
("&\\(\\sw+\\(::\\sw+\\)*\\)" 1 font-lock-function-name-face)
- ;; Additionally underline non-scalar variables. Maybe this is a bad idea.
+ ;; Additionally fontify non-scalar variables. `perl-non-scalar-variable'
+ ;; will underline them by default.
;;'("[$@%*][#{]?\\(\\sw+\\)" 1 font-lock-variable-name-face)
("[$*]{?\\(\\sw+\\(::\\sw+\\)*\\)" 1 font-lock-variable-name-face)
("\\([@%]\\|\\$#\\)\\(\\sw+\\(::\\sw+\\)*\\)"
- (2 (cons font-lock-variable-name-face '(underline))))
+ (2 'perl-non-scalar-variable))
("<\\(\\sw+\\)>" 1 font-lock-constant-face)
;;
;; Fontify keywords with/and labels as we do in `c++-font-lock-keywords'.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master b62a1e3: Add 'perl-non-scalar-variable' face to perl-mode,
Lars Ingebrigtsen <=