diff options
| author | Stefan Kangas | 2025-01-27 22:48:28 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2025-01-27 22:48:53 +0100 |
| commit | ba60fa3deaa030eb4815caa8c180ac841709e86a (patch) | |
| tree | b269274ff37fafa0bf375ff010fae811f63885d0 | |
| parent | 29c6dad78db6d599108612f120cd0fb1fb18e105 (diff) | |
| download | emacs-ba60fa3deaa030eb4815caa8c180ac841709e86a.tar.gz emacs-ba60fa3deaa030eb4815caa8c180ac841709e86a.zip | |
Don't use obsolete face variables in lisp-mode.el
* 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.
| -rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 9e8292b992a..bb9f2edac4e 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -433,10 +433,10 @@ This will generate compile-time constants from BINDINGS." | |||
| 433 | "\\(([ \t']*\\)?" ;; An opening paren. | 433 | "\\(([ \t']*\\)?" ;; An opening paren. |
| 434 | "\\(\\(setf\\)[ \t]+" (rx lisp-mode-symbol) | 434 | "\\(\\(setf\\)[ \t]+" (rx lisp-mode-symbol) |
| 435 | "\\|" (rx lisp-mode-symbol) "\\)?") | 435 | "\\|" (rx lisp-mode-symbol) "\\)?") |
| 436 | (1 font-lock-keyword-face) | 436 | (1 'font-lock-keyword-face) |
| 437 | (3 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type))) | 437 | (3 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type))) |
| 438 | (cond ((eq type 'var) font-lock-variable-name-face) | 438 | (cond ((eq type 'var) 'font-lock-variable-name-face) |
| 439 | ((eq type 'type) font-lock-type-face) | 439 | ((eq type 'type) 'font-lock-type-face) |
| 440 | ;; If match-string 2 is non-nil, we encountered a | 440 | ;; If match-string 2 is non-nil, we encountered a |
| 441 | ;; form like (defalias (intern (concat s "-p"))), | 441 | ;; form like (defalias (intern (concat s "-p"))), |
| 442 | ;; unless match-string 4 is also there. Then its a | 442 | ;; unless match-string 4 is also there. Then its a |
| @@ -444,12 +444,12 @@ This will generate compile-time constants from BINDINGS." | |||
| 444 | ((or (not (match-string 2)) ;; Normal defun. | 444 | ((or (not (match-string 2)) ;; Normal defun. |
| 445 | (and (match-string 2) ;; Setf method. | 445 | (and (match-string 2) ;; Setf method. |
| 446 | (match-string 4))) | 446 | (match-string 4))) |
| 447 | font-lock-function-name-face))) | 447 | 'font-lock-function-name-face))) |
| 448 | nil t)) | 448 | nil t)) |
| 449 | ;; Emacs Lisp autoload cookies. Supports the slightly different | 449 | ;; Emacs Lisp autoload cookies. Supports the slightly different |
| 450 | ;; forms used by mh-e, calendar, etc. | 450 | ;; forms used by mh-e, calendar, etc. |
| 451 | (,lisp-mode-autoload-regexp (3 font-lock-warning-face prepend) | 451 | (,lisp-mode-autoload-regexp (3 'font-lock-warning-face prepend) |
| 452 | (2 font-lock-function-name-face prepend t))) | 452 | (2 'font-lock-function-name-face prepend t))) |
| 453 | "Subdued level highlighting for Emacs Lisp mode.") | 453 | "Subdued level highlighting for Emacs Lisp mode.") |
| 454 | 454 | ||
| 455 | (defconst lisp-cl-font-lock-keywords-1 | 455 | (defconst lisp-cl-font-lock-keywords-1 |
| @@ -460,14 +460,14 @@ This will generate compile-time constants from BINDINGS." | |||
| 460 | "\\(([ \t']*\\)?" ;; An opening paren. | 460 | "\\(([ \t']*\\)?" ;; An opening paren. |
| 461 | "\\(\\(setf\\)[ \t]+" (rx lisp-mode-symbol) | 461 | "\\(\\(setf\\)[ \t]+" (rx lisp-mode-symbol) |
| 462 | "\\|" (rx lisp-mode-symbol) "\\)?") | 462 | "\\|" (rx lisp-mode-symbol) "\\)?") |
| 463 | (1 font-lock-keyword-face) | 463 | (1 'font-lock-keyword-face) |
| 464 | (3 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type))) | 464 | (3 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type))) |
| 465 | (cond ((eq type 'var) font-lock-variable-name-face) | 465 | (cond ((eq type 'var) 'font-lock-variable-name-face) |
| 466 | ((eq type 'type) font-lock-type-face) | 466 | ((eq type 'type) 'font-lock-type-face) |
| 467 | ((or (not (match-string 2)) ;; Normal defun. | 467 | ((or (not (match-string 2)) ;; Normal defun. |
| 468 | (and (match-string 2) ;; Setf function. | 468 | (and (match-string 2) ;; Setf function. |
| 469 | (match-string 4))) | 469 | (match-string 4))) |
| 470 | font-lock-function-name-face))) | 470 | 'font-lock-function-name-face))) |
| 471 | nil t))) | 471 | nil t))) |
| 472 | "Subdued level highlighting for Lisp modes.") | 472 | "Subdued level highlighting for Lisp modes.") |
| 473 | 473 | ||
| @@ -477,17 +477,17 @@ This will generate compile-time constants from BINDINGS." | |||
| 477 | (append | 477 | (append |
| 478 | lisp-el-font-lock-keywords-1 | 478 | lisp-el-font-lock-keywords-1 |
| 479 | `( ;; Regexp negated char group. | 479 | `( ;; Regexp negated char group. |
| 480 | ("\\[\\(\\^\\)" 1 font-lock-negation-char-face prepend) | 480 | ("\\[\\(\\^\\)" 1 'font-lock-negation-char-face prepend) |
| 481 | ;; Erroneous structures. | 481 | ;; Erroneous structures. |
| 482 | (,(concat "(" el-errs-re "\\_>") | 482 | (,(concat "(" el-errs-re "\\_>") |
| 483 | (1 font-lock-warning-face)) | 483 | (1 'font-lock-warning-face)) |
| 484 | ;; Control structures. Common Lisp forms. | 484 | ;; Control structures. Common Lisp forms. |
| 485 | (lisp--el-match-keyword . 1) | 485 | (lisp--el-match-keyword . 1) |
| 486 | ;; Exit/Feature symbols as constants. | 486 | ;; Exit/Feature symbols as constants. |
| 487 | (,(concat "(\\(catch\\|throw\\|featurep\\|provide\\|require\\)\\_>" | 487 | (,(concat "(\\(catch\\|throw\\|featurep\\|provide\\|require\\)\\_>" |
| 488 | "[ \t']*\\(" (rx lisp-mode-symbol) "\\)?") | 488 | "[ \t']*\\(" (rx lisp-mode-symbol) "\\)?") |
| 489 | (1 font-lock-keyword-face) | 489 | (1 'font-lock-keyword-face) |
| 490 | (2 font-lock-constant-face nil t)) | 490 | (2 'font-lock-constant-face nil t)) |
| 491 | ;; Words inside \\[], \\<>, \\{} or \\`' tend to be for | 491 | ;; Words inside \\[], \\<>, \\{} or \\`' tend to be for |
| 492 | ;; `substitute-command-keys'. | 492 | ;; `substitute-command-keys'. |
| 493 | (,(rx "\\\\" (or (seq "[" | 493 | (,(rx "\\\\" (or (seq "[" |
| @@ -496,27 +496,27 @@ This will generate compile-time constants from BINDINGS." | |||
| 496 | ;; allow multiple words, e.g. "C-x a" | 496 | ;; allow multiple words, e.g. "C-x a" |
| 497 | lisp-mode-symbol (* " " lisp-mode-symbol)) | 497 | lisp-mode-symbol (* " " lisp-mode-symbol)) |
| 498 | "'"))) | 498 | "'"))) |
| 499 | (1 font-lock-constant-face prepend)) | 499 | (1 'font-lock-constant-face prepend)) |
| 500 | (,(rx "\\\\" (or (seq "<" | 500 | (,(rx "\\\\" (or (seq "<" |
| 501 | (group-n 1 (seq lisp-mode-symbol (not "\\"))) ">") | 501 | (group-n 1 (seq lisp-mode-symbol (not "\\"))) ">") |
| 502 | (seq "{" | 502 | (seq "{" |
| 503 | (group-n 1 (seq lisp-mode-symbol (not "\\"))) "}"))) | 503 | (group-n 1 (seq lisp-mode-symbol (not "\\"))) "}"))) |
| 504 | (1 font-lock-variable-name-face prepend)) | 504 | (1 'font-lock-variable-name-face prepend)) |
| 505 | ;; Ineffective backslashes (typically in need of doubling). | 505 | ;; Ineffective backslashes (typically in need of doubling). |
| 506 | ("\\(\\\\\\)\\([^\"\\]\\)" | 506 | ("\\(\\\\\\)\\([^\"\\]\\)" |
| 507 | (1 (elisp--font-lock-backslash) prepend)) | 507 | (1 (elisp--font-lock-backslash) prepend)) |
| 508 | ;; Words inside ‘’, '' and `' tend to be symbol names. | 508 | ;; Words inside ‘’, '' and `' tend to be symbol names. |
| 509 | (,(concat "[`‘']\\(" (rx lisp-mode-symbol) "\\)['’]") | 509 | (,(concat "[`‘']\\(" (rx lisp-mode-symbol) "\\)['’]") |
| 510 | (1 font-lock-constant-face prepend)) | 510 | (1 'font-lock-constant-face prepend)) |
| 511 | ;; \\= tends to be an escape in doc strings. | 511 | ;; \\= tends to be an escape in doc strings. |
| 512 | (,(rx "\\\\=") | 512 | (,(rx "\\\\=") |
| 513 | (0 font-lock-builtin-face prepend)) | 513 | (0 'font-lock-builtin-face prepend)) |
| 514 | ;; Constant values. | 514 | ;; Constant values. |
| 515 | (,(lambda (bound) (lisp-mode--search-key ":" bound)) | 515 | (,(lambda (bound) (lisp-mode--search-key ":" bound)) |
| 516 | (0 font-lock-builtin-face)) | 516 | (0 'font-lock-builtin-face)) |
| 517 | ;; ELisp and CLisp `&' keywords as types. | 517 | ;; ELisp and CLisp `&' keywords as types. |
| 518 | (,(lambda (bound) (lisp-mode--search-key "&" bound)) | 518 | (,(lambda (bound) (lisp-mode--search-key "&" bound)) |
| 519 | (0 font-lock-type-face)) | 519 | (0 'font-lock-type-face)) |
| 520 | ;; ELisp regexp grouping constructs | 520 | ;; ELisp regexp grouping constructs |
| 521 | (,(lambda (bound) | 521 | (,(lambda (bound) |
| 522 | (catch 'found | 522 | (catch 'found |
| @@ -534,11 +534,11 @@ This will generate compile-time constants from BINDINGS." | |||
| 534 | (1 'font-lock-regexp-grouping-backslash prepend) | 534 | (1 'font-lock-regexp-grouping-backslash prepend) |
| 535 | (3 'font-lock-regexp-grouping-construct prepend)) | 535 | (3 'font-lock-regexp-grouping-construct prepend)) |
| 536 | (lisp--match-hidden-arg | 536 | (lisp--match-hidden-arg |
| 537 | (0 '(face font-lock-warning-face | 537 | (0 '(face 'font-lock-warning-face |
| 538 | help-echo "Easy to misread; consider moving the element to the next line") | 538 | help-echo "Easy to misread; consider moving the element to the next line") |
| 539 | prepend)) | 539 | prepend)) |
| 540 | (lisp--match-confusable-symbol-character | 540 | (lisp--match-confusable-symbol-character |
| 541 | 0 '(face font-lock-warning-face | 541 | 0 '(face 'font-lock-warning-face |
| 542 | help-echo "Confusable character")) | 542 | help-echo "Confusable character")) |
| 543 | )) | 543 | )) |
| 544 | "Gaudy level highlighting for Emacs Lisp mode.") | 544 | "Gaudy level highlighting for Emacs Lisp mode.") |
| @@ -547,29 +547,29 @@ This will generate compile-time constants from BINDINGS." | |||
| 547 | (append | 547 | (append |
| 548 | lisp-cl-font-lock-keywords-1 | 548 | lisp-cl-font-lock-keywords-1 |
| 549 | `( ;; Regexp negated char group. | 549 | `( ;; Regexp negated char group. |
| 550 | ("\\[\\(\\^\\)" 1 font-lock-negation-char-face prepend) | 550 | ("\\[\\(\\^\\)" 1 'font-lock-negation-char-face prepend) |
| 551 | ;; Control structures. Common Lisp forms. | 551 | ;; Control structures. Common Lisp forms. |
| 552 | (,(concat "(" cl-kws-re "\\_>") . 1) | 552 | (,(concat "(" cl-kws-re "\\_>") . 1) |
| 553 | ;; Exit/Feature symbols as constants. | 553 | ;; Exit/Feature symbols as constants. |
| 554 | (,(concat "(\\(catch\\|throw\\|provide\\|require\\)\\_>" | 554 | (,(concat "(\\(catch\\|throw\\|provide\\|require\\)\\_>" |
| 555 | "[ \t']*\\(" (rx lisp-mode-symbol) "\\)?") | 555 | "[ \t']*\\(" (rx lisp-mode-symbol) "\\)?") |
| 556 | (1 font-lock-keyword-face) | 556 | (1 'font-lock-keyword-face) |
| 557 | (2 font-lock-constant-face nil t)) | 557 | (2 'font-lock-constant-face nil t)) |
| 558 | ;; Erroneous structures. | 558 | ;; Erroneous structures. |
| 559 | (,(concat "(" cl-errs-re "\\_>") | 559 | (,(concat "(" cl-errs-re "\\_>") |
| 560 | (1 font-lock-warning-face)) | 560 | (1 'font-lock-warning-face)) |
| 561 | ;; Words inside ‘’ and `' tend to be symbol names. | 561 | ;; Words inside ‘’ and `' tend to be symbol names. |
| 562 | (,(concat "[`‘]\\(" (rx lisp-mode-symbol) "\\)['’]") | 562 | (,(concat "[`‘]\\(" (rx lisp-mode-symbol) "\\)['’]") |
| 563 | (1 font-lock-constant-face prepend)) | 563 | (1 'font-lock-constant-face prepend)) |
| 564 | ;; Uninterned symbols, e.g., (defpackage #:my-package ...) | 564 | ;; Uninterned symbols, e.g., (defpackage #:my-package ...) |
| 565 | ;; must come before keywords below to have effect | 565 | ;; must come before keywords below to have effect |
| 566 | (,(concat "#:" (rx lisp-mode-symbol) "") 0 font-lock-builtin-face) | 566 | (,(concat "#:" (rx lisp-mode-symbol) "") 0 'font-lock-builtin-face) |
| 567 | ;; Constant values. | 567 | ;; Constant values. |
| 568 | (,(lambda (bound) (lisp-mode--search-key ":" bound)) | 568 | (,(lambda (bound) (lisp-mode--search-key ":" bound)) |
| 569 | (0 font-lock-builtin-face)) | 569 | (0 'font-lock-builtin-face)) |
| 570 | ;; ELisp and CLisp `&' keywords as types. | 570 | ;; ELisp and CLisp `&' keywords as types. |
| 571 | (,(lambda (bound) (lisp-mode--search-key "&" bound)) | 571 | (,(lambda (bound) (lisp-mode--search-key "&" bound)) |
| 572 | (0 font-lock-type-face)) | 572 | (0 'font-lock-type-face)) |
| 573 | ;; ELisp regexp grouping constructs | 573 | ;; ELisp regexp grouping constructs |
| 574 | ;; This is too general -- rms. | 574 | ;; This is too general -- rms. |
| 575 | ;; A user complained that he has functions whose names start with `do' | 575 | ;; A user complained that he has functions whose names start with `do' |
| @@ -577,9 +577,9 @@ This will generate compile-time constants from BINDINGS." | |||
| 577 | ;; That user has violated the https://www.cliki.net/Naming+conventions: | 577 | ;; That user has violated the https://www.cliki.net/Naming+conventions: |
| 578 | ;; CL (but not EL!) `with-' (context) and `do-' (iteration) | 578 | ;; CL (but not EL!) `with-' (context) and `do-' (iteration) |
| 579 | (,(concat "(\\(\\(do-\\|with-\\)" (rx lisp-mode-symbol) "\\)") | 579 | (,(concat "(\\(\\(do-\\|with-\\)" (rx lisp-mode-symbol) "\\)") |
| 580 | (1 font-lock-keyword-face)) | 580 | (1 'font-lock-keyword-face)) |
| 581 | (lisp--match-hidden-arg | 581 | (lisp--match-hidden-arg |
| 582 | (0 '(face font-lock-warning-face | 582 | (0 '(face 'font-lock-warning-face |
| 583 | help-echo "Easy to misread; consider moving the element to the next line") | 583 | help-echo "Easy to misread; consider moving the element to the next line") |
| 584 | prepend)) | 584 | prepend)) |
| 585 | )) | 585 | )) |