aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/perl-mode.el23
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 ()