diff options
| author | Stefan Monnier | 2025-04-04 23:53:10 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2025-04-04 23:53:10 -0400 |
| commit | cd41247dc18f4e478ffb296198229ee22d44668c (patch) | |
| tree | f8c98cecba22ddb569b5ca394e3620da3233bc7a | |
| parent | d582ed9dc9be516f17dc9a526c3f9615001a46a6 (diff) | |
| download | emacs-cd41247dc18f4e478ffb296198229ee22d44668c.tar.gz emacs-cd41247dc18f4e478ffb296198229ee22d44668c.zip | |
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.
| -rw-r--r-- | lisp/progmodes/perl-mode.el | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index c95cf3af017..7820a599301 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el | |||
| @@ -96,9 +96,8 @@ | |||
| 96 | "Face used for non-scalar variables." | 96 | "Face used for non-scalar variables." |
| 97 | :version "28.1") | 97 | :version "28.1") |
| 98 | 98 | ||
| 99 | (defvar perl-mode-abbrev-table nil | 99 | (define-abbrev-table 'perl-mode-abbrev-table () |
| 100 | "Abbrev table in use in `perl-mode' buffers.") | 100 | "Abbrev table in use in perl-mode buffers.") |
| 101 | (define-abbrev-table 'perl-mode-abbrev-table ()) | ||
| 102 | 101 | ||
| 103 | (defvar-keymap perl-mode-map | 102 | (defvar-keymap perl-mode-map |
| 104 | :doc "Keymap used in Perl mode." | 103 | :doc "Keymap used in Perl mode." |
| @@ -165,19 +164,19 @@ | |||
| 165 | ;; | 164 | ;; |
| 166 | ;; Fontify function and package names in declarations. | 165 | ;; Fontify function and package names in declarations. |
| 167 | ("\\<\\(package\\|sub\\)\\>[ \t]*\\(\\(?:\\sw\\|::\\)+\\)?" | 166 | ("\\<\\(package\\|sub\\)\\>[ \t]*\\(\\(?:\\sw\\|::\\)+\\)?" |
| 168 | (1 font-lock-keyword-face) (2 font-lock-function-name-face nil t)) | 167 | (1 'font-lock-keyword-face) (2 'font-lock-function-name-face nil t)) |
| 169 | ("\\(?:^\\|[^$@%&\\]\\)\\<\\(import\\|no\\|require\\|use\\)\\>[ \t]*\\(\\(?:\\sw\\|::\\)+\\)?" | 168 | ("\\(?:^\\|[^$@%&\\]\\)\\<\\(import\\|no\\|require\\|use\\)\\>[ \t]*\\(\\(?:\\sw\\|::\\)+\\)?" |
| 170 | (1 font-lock-keyword-face) (2 font-lock-constant-face nil t))) | 169 | (1 'font-lock-keyword-face) (2 'font-lock-constant-face nil t))) |
| 171 | "Subdued level highlighting for Perl mode.") | 170 | "Subdued level highlighting for Perl mode.") |
| 172 | 171 | ||
| 173 | (defconst perl-font-lock-keywords-2 | 172 | (defconst perl-font-lock-keywords-2 |
| 174 | (append | 173 | (append |
| 175 | '(;; Fontify function, variable and file name references. They have to be | 174 | '(;; Fontify function, variable and file name references. They have to be |
| 176 | ;; handled first because they might conflict with keywords. | 175 | ;; handled first because they might conflict with keywords. |
| 177 | ("&\\(\\sw+\\(::\\sw+\\)*\\)" 1 font-lock-function-name-face) | 176 | ("&\\(\\sw+\\(::\\sw+\\)*\\)" 1 'font-lock-function-name-face) |
| 178 | ;; Additionally fontify non-scalar variables. `perl-non-scalar-variable' | 177 | ;; Additionally fontify non-scalar variables. `perl-non-scalar-variable' |
| 179 | ;; will underline them by default. | 178 | ;; will underline them by default. |
| 180 | ("[$*]{?\\(\\sw+\\(::\\sw+\\)*\\)" 1 font-lock-variable-name-face) | 179 | ("[$*]{?\\(\\sw+\\(::\\sw+\\)*\\)" 1 'font-lock-variable-name-face) |
| 181 | ("\\([@%]\\|\\$#\\)\\(\\sw+\\(::\\sw+\\)*\\)" | 180 | ("\\([@%]\\|\\$#\\)\\(\\sw+\\(::\\sw+\\)*\\)" |
| 182 | (2 'perl-non-scalar-variable))) | 181 | (2 'perl-non-scalar-variable))) |
| 183 | perl-font-lock-keywords-1 | 182 | perl-font-lock-keywords-1 |
| @@ -191,13 +190,13 @@ | |||
| 191 | "\\>") | 190 | "\\>") |
| 192 | ;; | 191 | ;; |
| 193 | ;; Fontify declarators and prefixes as types. | 192 | ;; Fontify declarators and prefixes as types. |
| 194 | ("\\<\\(has\\|local\\|my\\|our\\|state\\)\\>" . font-lock-keyword-face) ; declarators | 193 | ("\\<\\(has\\|local\\|my\\|our\\|state\\)\\>" . 'font-lock-keyword-face) ; declarators |
| 195 | ("<\\(\\sw+\\)>" 1 font-lock-constant-face) | 194 | ("<\\(\\sw+\\)>" 1 'font-lock-constant-face) |
| 196 | ;; | 195 | ;; |
| 197 | ;; Fontify keywords with/and labels as we do in `c++-font-lock-keywords'. | 196 | ;; Fontify keywords with/and labels as we do in `c++-font-lock-keywords'. |
| 198 | ("\\<\\(continue\\|goto\\|last\\|next\\|redo\\)\\>[ \t]*\\(\\sw+\\)?" | 197 | ("\\<\\(continue\\|goto\\|last\\|next\\|redo\\)\\>[ \t]*\\(\\sw+\\)?" |
| 199 | (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) | 198 | (1 'font-lock-keyword-face) (2 'font-lock-constant-face nil t)) |
| 200 | ("^[ \t]*\\(\\sw+\\)[ \t]*:[^:]" 1 font-lock-constant-face))) | 199 | ("^[ \t]*\\(\\sw+\\)[ \t]*:[^:]" 1 'font-lock-constant-face))) |
| 201 | "Gaudy level highlighting for Perl mode.") | 200 | "Gaudy level highlighting for Perl mode.") |
| 202 | 201 | ||
| 203 | (defvar perl-font-lock-keywords perl-font-lock-keywords-1 | 202 | (defvar perl-font-lock-keywords perl-font-lock-keywords-1 |
| @@ -631,7 +630,7 @@ create a new comment." | |||
| 631 | ;; Outline support | 630 | ;; Outline support |
| 632 | 631 | ||
| 633 | (defvar perl-outline-regexp | 632 | (defvar perl-outline-regexp |
| 634 | (concat (mapconcat 'cadr perl-imenu-generic-expression "\\|") | 633 | (concat (mapconcat #'cadr perl-imenu-generic-expression "\\|") |
| 635 | "\\|^=cut\\>")) | 634 | "\\|^=cut\\>")) |
| 636 | 635 | ||
| 637 | (defun perl-outline-level () | 636 | (defun perl-outline-level () |