]> git.eshelyaron.com Git - emacs.git/commitdiff
perl-mode.el: Avoid obsolete font-lock face vars
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 5 Apr 2025 03:53:10 +0000 (23:53 -0400)
committerEshel Yaron <me@eshelyaron.com>
Tue, 8 Apr 2025 05:41:46 +0000 (07:41 +0200)
* 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

index 0c75ea8f4d7d275de69a277fe5e19669a1ac846f..df60889936342f4a41866f0ab79371f98cc46e14 100644 (file)
@@ -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."
     ;;
     ;; 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
               "\\>")
      ;;
      ;; 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 ()