Remove XEmacs and Emacs 21 compat code from cperl-mode

* lisp/progmodes/cperl-mode.el (cperl-mode): Remove XEmacs and
Emacs 21 compat code.
(cperl-compilation-error-regexp-list): New variable.
(cperl-compilation-error-regexp-alist): Make obsolete.
This commit is contained in:
Stefan Kangas 2021-02-12 19:07:12 +01:00
parent c3163069a1
commit bdd8d5b6a4

View file

@ -1396,13 +1396,15 @@ the last)."
(defvar cperl-font-lock-multiline nil)
(defvar cperl-font-locking nil)
;; NB as it stands the code in cperl-mode assumes this only has one
;; element. Since XEmacs 19 support has been dropped, this could all be simplified.
(defvar cperl-compilation-error-regexp-alist
(defvar cperl-compilation-error-regexp-list
;; This look like a paranoiac regexp: could anybody find a better one? (which WORKS).
'(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]"
2 3))
"Alist that specifies how to match errors in perl output.")
'("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]"
2 3)
"List that specifies how to match errors in Perl output.")
(defvar cperl-compilation-error-regexp-alist)
(make-obsolete-variable 'cperl-compilation-error-regexp-alist
'cperl-compilation-error-regexp-list "28.1")
(defvar compilation-error-regexp-alist)
@ -1639,19 +1641,18 @@ or as help on variables `cperl-tips', `cperl-problems',
(setq-local imenu-sort-function nil)
(setq-local vc-rcs-header cperl-vc-rcs-header)
(setq-local vc-sccs-header cperl-vc-sccs-header)
(cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x
(setq-local compilation-error-regexp-alist-alist
(cons (cons 'cperl (car cperl-compilation-error-regexp-alist))
compilation-error-regexp-alist-alist))
(if (fboundp 'compilation-build-compilation-error-regexp-alist)
(let ((f 'compilation-build-compilation-error-regexp-alist))
(funcall f))
(make-local-variable 'compilation-error-regexp-alist)
(push 'cperl compilation-error-regexp-alist)))
((boundp 'compilation-error-regexp-alist);; xemacs 19.x
(setq-local compilation-error-regexp-alist
(append cperl-compilation-error-regexp-alist
compilation-error-regexp-alist))))
(when (boundp 'compilation-error-regexp-alist-alist)
;; The let here is just a compatibility kludge for the obsolete
;; variable `cperl-compilation-error-regexp-alist'. It can be removed
;; when that variable is removed.
(let ((regexp (if (boundp 'cperl-compilation-error-regexp-alist)
(car cperl-compilation-error-regexp-alist)
cperl-compilation-error-regexp-list)))
(setq-local compilation-error-regexp-alist-alist
(cons (cons 'cperl regexp)
compilation-error-regexp-alist-alist)))
(make-local-variable 'compilation-error-regexp-alist)
(push 'cperl compilation-error-regexp-alist))
(setq-local font-lock-defaults
'((cperl-load-font-lock-keywords
cperl-load-font-lock-keywords-1