]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't use obsolete face variables in lisp-mode.el
authorStefan Kangas <stefankangas@gmail.com>
Mon, 27 Jan 2025 21:48:28 +0000 (22:48 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 30 Jan 2025 18:08:35 +0000 (19:08 +0100)
* lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-1)
(lisp-cl-font-lock-keywords-1, lisp-el-font-lock-keywords-2)
(lisp-cl-font-lock-keywords-2): Don't use obsolete face variables.

(cherry picked from commit ba60fa3deaa030eb4815caa8c180ac841709e86a)

lisp/emacs-lisp/lisp-mode.el

index 76f072b46e8449362b286b68b984c598cfe04980..9c1fe4efdcd28b7bba2f2fdfe6bfddada8897b03 100644 (file)
@@ -430,10 +430,10 @@ This will generate compile-time constants from BINDINGS."
                   "\\(([ \t']*\\)?" ;; An opening paren.
                   "\\(\\(setf\\)[ \t]+" (rx lisp-mode-symbol)
                   "\\|" (rx lisp-mode-symbol) "\\)?")
-          (1 font-lock-keyword-face)
+          (1 'font-lock-keyword-face)
           (3 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type)))
-               (cond ((eq type 'var) font-lock-variable-name-face)
-                     ((eq type 'type) font-lock-type-face)
+               (cond ((eq type 'var) 'font-lock-variable-name-face)
+                     ((eq type 'type) 'font-lock-type-face)
                      ;; If match-string 2 is non-nil, we encountered a
                      ;; form like (defalias (intern (concat s "-p"))),
                      ;; unless match-string 4 is also there.  Then its a
@@ -441,12 +441,12 @@ This will generate compile-time constants from BINDINGS."
                      ((or (not (match-string 2)) ;; Normal defun.
                           (and (match-string 2)  ;; Setf method.
                                (match-string 4)))
-                      font-lock-function-name-face)))
+                      'font-lock-function-name-face)))
              nil t))
         ;; Emacs Lisp autoload cookies.  Supports the slightly different
         ;; forms used by mh-e, calendar, etc.
-        (,lisp-mode-autoload-regexp (3 font-lock-warning-face prepend)
-                                    (2 font-lock-function-name-face prepend t)))
+        (,lisp-mode-autoload-regexp (3 'font-lock-warning-face prepend)
+                                    (2 'font-lock-function-name-face prepend t)))
       "Subdued level highlighting for Emacs Lisp mode.")
 
     (defconst lisp-cl-font-lock-keywords-1
@@ -457,14 +457,14 @@ This will generate compile-time constants from BINDINGS."
                   "\\(([ \t']*\\)?" ;; An opening paren.
                   "\\(\\(setf\\)[ \t]+" (rx lisp-mode-symbol)
                   "\\|" (rx lisp-mode-symbol) "\\)?")
-          (1 font-lock-keyword-face)
+          (1 'font-lock-keyword-face)
           (3 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type)))
-               (cond ((eq type 'var) font-lock-variable-name-face)
-                     ((eq type 'type) font-lock-type-face)
+               (cond ((eq type 'var) 'font-lock-variable-name-face)
+                     ((eq type 'type) 'font-lock-type-face)
                      ((or (not (match-string 2)) ;; Normal defun.
                           (and (match-string 2)  ;; Setf function.
                                (match-string 4)))
-                      font-lock-function-name-face)))
+                      'font-lock-function-name-face)))
              nil t)))
       "Subdued level highlighting for Lisp modes.")
 
@@ -474,17 +474,17 @@ This will generate compile-time constants from BINDINGS."
       (append
        lisp-el-font-lock-keywords-1
        `( ;; Regexp negated char group.
-         ("\\[\\(\\^\\)" 1 font-lock-negation-char-face prepend)
+         ("\\[\\(\\^\\)" 1 'font-lock-negation-char-face prepend)
          ;; Erroneous structures.
          (,(concat "(" el-errs-re "\\_>")
-          (1 font-lock-warning-face))
+          (1 'font-lock-warning-face))
          ;; Control structures.  Common Lisp forms.
          (lisp--el-match-keyword . 1)
          ;; Exit/Feature symbols as constants.
          (,(concat "(\\(catch\\|throw\\|featurep\\|provide\\|require\\)\\_>"
                    "[ \t']*\\(" (rx lisp-mode-symbol) "\\)?")
-           (1 font-lock-keyword-face)
-           (2 font-lock-constant-face nil t))
+           (1 'font-lock-keyword-face)
+           (2 'font-lock-constant-face nil t))
          ;; Words inside \\[], \\<>, \\{} or \\`' tend to be for
          ;; `substitute-command-keys'.
          (,(rx "\\\\" (or (seq "["
@@ -493,27 +493,27 @@ This will generate compile-time constants from BINDINGS."
                                      ;; allow multiple words, e.g. "C-x a"
                                      lisp-mode-symbol (* " " lisp-mode-symbol))
                                "'")))
-          (1 font-lock-constant-face prepend))
+          (1 'font-lock-constant-face prepend))
          (,(rx "\\\\" (or (seq "<"
                                (group-n 1 (seq lisp-mode-symbol (not "\\"))) ">")
                           (seq "{"
                                (group-n 1 (seq lisp-mode-symbol (not "\\"))) "}")))
-          (1 font-lock-variable-name-face prepend))
+          (1 'font-lock-variable-name-face prepend))
          ;; Ineffective backslashes (typically in need of doubling).
          ("\\(\\\\\\)\\([^\"\\]\\)"
           (1 (elisp--font-lock-backslash) prepend))
          ;; Words inside ‘’, '' and `' tend to be symbol names.
          (,(concat "[`‘']\\(" (rx lisp-mode-symbol) "\\)['’]")
-          (1 font-lock-constant-face prepend))
+          (1 'font-lock-constant-face prepend))
          ;; \\= tends to be an escape in doc strings.
          (,(rx "\\\\=")
-          (0 font-lock-builtin-face prepend))
+          (0 'font-lock-builtin-face prepend))
          ;; Constant values.
          (,(lambda (bound) (lisp-mode--search-key ":" bound))
-          (0 font-lock-builtin-face))
+          (0 'font-lock-builtin-face))
          ;; ELisp and CLisp `&' keywords as types.
          (,(lambda (bound) (lisp-mode--search-key "&" bound))
-          (0 font-lock-type-face))
+          (0 'font-lock-type-face))
          ;; ELisp regexp grouping constructs
          (,(lambda (bound)
              (catch 'found
@@ -531,11 +531,11 @@ This will generate compile-time constants from BINDINGS."
            (1 'font-lock-regexp-grouping-backslash prepend)
            (3 'font-lock-regexp-grouping-construct prepend))
          (lisp--match-hidden-arg
-          (0 '(face font-lock-warning-face
+          (0 '(face 'font-lock-warning-face
                help-echo "Easy to misread; consider moving the element to the next line")
              prepend))
          (lisp--match-confusable-symbol-character
-          0 '(face font-lock-warning-face
+          0 '(face 'font-lock-warning-face
                     help-echo "Confusable character"))
          ))
       "Gaudy level highlighting for Emacs Lisp mode.")
@@ -544,29 +544,29 @@ This will generate compile-time constants from BINDINGS."
       (append
        lisp-cl-font-lock-keywords-1
        `( ;; Regexp negated char group.
-         ("\\[\\(\\^\\)" 1 font-lock-negation-char-face prepend)
+         ("\\[\\(\\^\\)" 1 'font-lock-negation-char-face prepend)
          ;; Control structures.  Common Lisp forms.
          (,(concat "(" cl-kws-re "\\_>") . 1)
          ;; Exit/Feature symbols as constants.
          (,(concat "(\\(catch\\|throw\\|provide\\|require\\)\\_>"
                    "[ \t']*\\(" (rx lisp-mode-symbol) "\\)?")
-           (1 font-lock-keyword-face)
-           (2 font-lock-constant-face nil t))
+           (1 'font-lock-keyword-face)
+           (2 'font-lock-constant-face nil t))
          ;; Erroneous structures.
          (,(concat "(" cl-errs-re "\\_>")
-           (1 font-lock-warning-face))
+           (1 'font-lock-warning-face))
          ;; Words inside ‘’ and `' tend to be symbol names.
          (,(concat "[`‘]\\(" (rx lisp-mode-symbol) "\\)['’]")
-          (1 font-lock-constant-face prepend))
+          (1 'font-lock-constant-face prepend))
          ;; Uninterned symbols, e.g., (defpackage #:my-package ...)
          ;; must come before keywords below to have effect
-         (,(concat "#:" (rx lisp-mode-symbol) "") 0 font-lock-builtin-face)
+         (,(concat "#:" (rx lisp-mode-symbol) "") 0 'font-lock-builtin-face)
          ;; Constant values.
          (,(lambda (bound) (lisp-mode--search-key ":" bound))
-          (0 font-lock-builtin-face))
+          (0 'font-lock-builtin-face))
          ;; ELisp and CLisp `&' keywords as types.
          (,(lambda (bound) (lisp-mode--search-key "&" bound))
-          (0 font-lock-type-face))
+          (0 'font-lock-type-face))
          ;; ELisp regexp grouping constructs
          ;; This is too general -- rms.
          ;; A user complained that he has functions whose names start with `do'
@@ -574,9 +574,9 @@ This will generate compile-time constants from BINDINGS."
          ;; That user has violated the https://www.cliki.net/Naming+conventions:
          ;; CL (but not EL!) `with-' (context) and `do-' (iteration)
          (,(concat "(\\(\\(do-\\|with-\\)" (rx lisp-mode-symbol) "\\)")
-           (1 font-lock-keyword-face))
+           (1 'font-lock-keyword-face))
          (lisp--match-hidden-arg
-          (0 '(face font-lock-warning-face
+          (0 '(face 'font-lock-warning-face
                help-echo "Easy to misread; consider moving the element to the next line")
              prepend))
          ))