From cefdac78c4ab8b4bd0bef50ec22701b42bfcbaf6 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 4 Apr 2025 23:53:10 -0400 Subject: [PATCH] perl-mode.el: Avoid obsolete font-lock face vars * lisp/progmodes/perl-mode.el (perl-mode-abbrev-table): Merge defvar into the definition. (perl-font-lock-keywords-1, perl-font-lock-keywords-2): Avoid obsolete font-lock face vars. (cherry picked from commit cd41247dc18f4e478ffb296198229ee22d44668c) --- lisp/progmodes/perl-mode.el | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index 0c75ea8f4d7..df608899363 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -96,9 +96,8 @@ "Face used for non-scalar variables." :version "28.1") -(defvar perl-mode-abbrev-table nil - "Abbrev table in use in `perl-mode' buffers.") -(define-abbrev-table 'perl-mode-abbrev-table ()) +(define-abbrev-table 'perl-mode-abbrev-table () + "Abbrev table in use in perl-mode buffers.") (defvar-keymap perl-mode-map :doc "Keymap used in Perl mode." @@ -165,19 +164,19 @@ ;; ;; Fontify function and package names in declarations. ("\\<\\(package\\|sub\\)\\>[ \t]*\\(\\(?:\\sw\\|::\\)+\\)?" - (1 font-lock-keyword-face) (2 font-lock-function-name-face nil t)) + (1 'font-lock-keyword-face) (2 'font-lock-function-name-face nil t)) ("\\(?:^\\|[^$@%&\\]\\)\\<\\(import\\|no\\|require\\|use\\)\\>[ \t]*\\(\\(?:\\sw\\|::\\)+\\)?" - (1 font-lock-keyword-face) (2 font-lock-constant-face nil t))) + (1 'font-lock-keyword-face) (2 'font-lock-constant-face nil t))) "Subdued level highlighting for Perl mode.") (defconst perl-font-lock-keywords-2 (append '(;; Fontify function, variable and file name references. They have to be ;; handled first because they might conflict with keywords. - ("&\\(\\sw+\\(::\\sw+\\)*\\)" 1 font-lock-function-name-face) + ("&\\(\\sw+\\(::\\sw+\\)*\\)" 1 'font-lock-function-name-face) ;; Additionally fontify non-scalar variables. `perl-non-scalar-variable' ;; will underline them by default. - ("[$*]{?\\(\\sw+\\(::\\sw+\\)*\\)" 1 font-lock-variable-name-face) + ("[$*]{?\\(\\sw+\\(::\\sw+\\)*\\)" 1 'font-lock-variable-name-face) ("\\([@%]\\|\\$#\\)\\(\\sw+\\(::\\sw+\\)*\\)" (2 'perl-non-scalar-variable))) perl-font-lock-keywords-1 @@ -191,13 +190,13 @@ "\\>") ;; ;; Fontify declarators and prefixes as types. - ("\\<\\(has\\|local\\|my\\|our\\|state\\)\\>" . font-lock-keyword-face) ; declarators - ("<\\(\\sw+\\)>" 1 font-lock-constant-face) + ("\\<\\(has\\|local\\|my\\|our\\|state\\)\\>" . 'font-lock-keyword-face) ; declarators + ("<\\(\\sw+\\)>" 1 'font-lock-constant-face) ;; ;; Fontify keywords with/and labels as we do in `c++-font-lock-keywords'. ("\\<\\(continue\\|goto\\|last\\|next\\|redo\\)\\>[ \t]*\\(\\sw+\\)?" - (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) - ("^[ \t]*\\(\\sw+\\)[ \t]*:[^:]" 1 font-lock-constant-face))) + (1 'font-lock-keyword-face) (2 'font-lock-constant-face nil t)) + ("^[ \t]*\\(\\sw+\\)[ \t]*:[^:]" 1 'font-lock-constant-face))) "Gaudy level highlighting for Perl mode.") (defvar perl-font-lock-keywords perl-font-lock-keywords-1 @@ -631,7 +630,7 @@ create a new comment." ;; Outline support (defvar perl-outline-regexp - (concat (mapconcat 'cadr perl-imenu-generic-expression "\\|") + (concat (mapconcat #'cadr perl-imenu-generic-expression "\\|") "\\|^=cut\\>")) (defun perl-outline-level () -- 2.39.5