aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2020-08-16 13:11:16 +0200
committerStefan Kangas2020-08-21 10:32:51 +0200
commit178feeec4609e021ae9aa09c673ae19d86529228 (patch)
tree404347397b1801710728647f05ba784c4972caa7
parent165fd028d858daee3e08e4308b24e5d497971c77 (diff)
downloademacs-178feeec4609e021ae9aa09c673ae19d86529228.tar.gz
emacs-178feeec4609e021ae9aa09c673ae19d86529228.zip
Remove some compat code from cperl-mode
* lisp/progmodes/cperl-mode.el (cperl-use-syntax-table-text-property) (cperl-syntaxify-by-font-lock, cperl-mode-map, cperl-mode) (cperl-windowed-init, cperl-init-faces, cperl-write-tags): Remove some XEmacs and <21 compat code.
-rw-r--r--lisp/progmodes/cperl-mode.el35
1 files changed, 9 insertions, 26 deletions
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 2d2713a36ab..c47aa2ea8c2 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -451,8 +451,7 @@ Older version of this page was called `perl5', newer `perl'."
451 :type 'string 451 :type 'string
452 :group 'cperl-help-system) 452 :group 'cperl-help-system)
453 453
454(defcustom cperl-use-syntax-table-text-property 454(defcustom cperl-use-syntax-table-text-property t
455 (boundp 'parse-sexp-lookup-properties)
456 "Non-nil means CPerl sets up and uses `syntax-table' text property." 455 "Non-nil means CPerl sets up and uses `syntax-table' text property."
457 :type 'boolean 456 :type 'boolean
458 :group 'cperl-speed) 457 :group 'cperl-speed)
@@ -535,8 +534,7 @@ One should tune up `cperl-close-paren-offset' as well."
535 :type 'boolean 534 :type 'boolean
536 :group 'cperl-indentation-details) 535 :group 'cperl-indentation-details)
537 536
538(defcustom cperl-syntaxify-by-font-lock 537(defcustom cperl-syntaxify-by-font-lock t
539 (boundp 'parse-sexp-lookup-properties)
540 "Non-nil means that CPerl uses the `font-lock' routines for syntaxification." 538 "Non-nil means that CPerl uses the `font-lock' routines for syntaxification."
541 :type '(choice (const message) boolean) 539 :type '(choice (const message) boolean)
542 :group 'cperl-speed) 540 :group 'cperl-speed)
@@ -1081,10 +1079,6 @@ versions of Emacs."
1081 (define-key map [(control ?c) (control ?h) ?v] 1079 (define-key map [(control ?c) (control ?h) ?v]
1082 ;;(concat (char-to-string help-char) "v") ; does not work 1080 ;;(concat (char-to-string help-char) "v") ; does not work
1083 'cperl-get-help)) 1081 'cperl-get-help))
1084 (or (boundp 'fill-paragraph-function)
1085 (substitute-key-definition
1086 'fill-paragraph 'cperl-fill-paragraph
1087 map global-map))
1088 (substitute-key-definition 1082 (substitute-key-definition
1089 'indent-sexp 'cperl-indent-exp 1083 'indent-sexp 'cperl-indent-exp
1090 map global-map) 1084 map global-map)
@@ -1637,9 +1631,8 @@ or as help on variables `cperl-tips', `cperl-problems',
1637 "\\)" 1631 "\\)"
1638 cperl-maybe-white-and-comment-rex)) 1632 cperl-maybe-white-and-comment-rex))
1639 (set (make-local-variable 'comment-indent-function) #'cperl-comment-indent) 1633 (set (make-local-variable 'comment-indent-function) #'cperl-comment-indent)
1640 (and (boundp 'fill-paragraph-function) 1634 (set (make-local-variable 'fill-paragraph-function)
1641 (set (make-local-variable 'fill-paragraph-function) 1635 #'cperl-fill-paragraph)
1642 #'cperl-fill-paragraph))
1643 (set (make-local-variable 'parse-sexp-ignore-comments) t) 1636 (set (make-local-variable 'parse-sexp-ignore-comments) t)
1644 (set (make-local-variable 'indent-region-function) #'cperl-indent-region) 1637 (set (make-local-variable 'indent-region-function) #'cperl-indent-region)
1645 ;;(setq auto-fill-function #'cperl-do-auto-fill) ; Need to switch on and off! 1638 ;;(setq auto-fill-function #'cperl-do-auto-fill) ; Need to switch on and off!
@@ -1701,13 +1694,8 @@ or as help on variables `cperl-tips', `cperl-problems',
1701 ;; to make font-lock think that font-lock-syntactic-keywords 1694 ;; to make font-lock think that font-lock-syntactic-keywords
1702 ;; are defined. 1695 ;; are defined.
1703 '(t))))) 1696 '(t)))))
1704 (if (boundp 'font-lock-multiline) ; Newer font-lock; use its facilities 1697 (setq cperl-font-lock-multiline t) ; Not localized...
1705 (progn 1698 (set (make-local-variable 'font-lock-multiline) t)
1706 (setq cperl-font-lock-multiline t) ; Not localized...
1707 (set (make-local-variable 'font-lock-multiline) t))
1708 (set (make-local-variable 'font-lock-fontify-region-function)
1709 ;; not present with old Emacs
1710 #'cperl-font-lock-fontify-region-function))
1711 (set (make-local-variable 'font-lock-fontify-region-function) 1699 (set (make-local-variable 'font-lock-fontify-region-function)
1712 #'cperl-font-lock-fontify-region-function) 1700 #'cperl-font-lock-fontify-region-function)
1713 (make-local-variable 'cperl-old-style) 1701 (make-local-variable 'cperl-old-style)
@@ -5451,8 +5439,7 @@ indentation and initial hashes. Behaves usually outside of comment."
5451 (cond ((featurep 'ps-print) 5439 (cond ((featurep 'ps-print)
5452 (or cperl-faces-init 5440 (or cperl-faces-init
5453 (progn 5441 (progn
5454 (and (boundp 'font-lock-multiline) 5442 (setq cperl-font-lock-multiline t)
5455 (setq cperl-font-lock-multiline t))
5456 (cperl-init-faces)))) 5443 (cperl-init-faces))))
5457 ((not cperl-faces-init) 5444 ((not cperl-faces-init)
5458 (add-hook 'font-lock-mode-hook 5445 (add-hook 'font-lock-mode-hook
@@ -5499,12 +5486,8 @@ indentation and initial hashes. Behaves usually outside of comment."
5499 (condition-case errs 5486 (condition-case errs
5500 (progn 5487 (progn
5501 (require 'font-lock) 5488 (require 'font-lock)
5502 (and (fboundp 'font-lock-fontify-anchored-keywords)
5503 (featurep 'font-lock-extra)
5504 (message "You have an obsolete package `font-lock-extra'. Install `choose-color'."))
5505 (let (t-font-lock-keywords t-font-lock-keywords-1 font-lock-anchored) 5489 (let (t-font-lock-keywords t-font-lock-keywords-1 font-lock-anchored)
5506 (if (fboundp 'font-lock-fontify-anchored-keywords) 5490 (setq font-lock-anchored t)
5507 (setq font-lock-anchored t))
5508 (setq 5491 (setq
5509 t-font-lock-keywords 5492 t-font-lock-keywords
5510 (list 5493 (list
@@ -6857,7 +6840,7 @@ Use as
6857 (insert (cperl-find-tags file xs topdir)))))) 6840 (insert (cperl-find-tags file xs topdir))))))
6858 (if inbuffer nil ; Delegate to the caller 6841 (if inbuffer nil ; Delegate to the caller
6859 (save-buffer 0) ; No backup 6842 (save-buffer 0) ; No backup
6860 (if (fboundp 'initialize-new-tags-table) ; Do we need something special in XEmacs? 6843 (if (fboundp 'initialize-new-tags-table)
6861 (initialize-new-tags-table)))))) 6844 (initialize-new-tags-table))))))
6862 6845
6863(defvar cperl-tags-hier-regexp-list 6846(defvar cperl-tags-hier-regexp-list