diff options
| author | Lars Ingebrigtsen | 2019-10-19 11:31:58 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-10-19 11:32:04 +0200 |
| commit | 842cc05d5ca5e54aef5c455a92203fd512e89202 (patch) | |
| tree | 613d93606b319a90d873dd467ba11b40fb0149fe | |
| parent | 8dd18bbb6f3c09a4988cf2e06378aa24b098fb85 (diff) | |
| download | emacs-842cc05d5ca5e54aef5c455a92203fd512e89202.tar.gz emacs-842cc05d5ca5e54aef5c455a92203fd512e89202.zip | |
Remove some compat code from cperl-mode.el
* lisp/progmodes/cperl-mode.el: Remove old-Emacs compat code.
| -rw-r--r-- | lisp/progmodes/cperl-mode.el | 112 |
1 files changed, 24 insertions, 88 deletions
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 3c06d230950..5d4cf96d4c4 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el | |||
| @@ -77,43 +77,17 @@ | |||
| 77 | 77 | ||
| 78 | (eval-when-compile (require 'cl-lib)) | 78 | (eval-when-compile (require 'cl-lib)) |
| 79 | 79 | ||
| 80 | (defvar msb-menu-cond) | ||
| 81 | (defvar gud-perldb-history) | ||
| 80 | (defvar vc-rcs-header) | 82 | (defvar vc-rcs-header) |
| 81 | (defvar vc-sccs-header) | 83 | (defvar vc-sccs-header) |
| 82 | 84 | ||
| 83 | (eval-when-compile | 85 | (defmacro cperl-force-face (arg descr) ; Takes unquoted arg |
| 84 | (condition-case nil | 86 | `(progn |
| 85 | (require 'custom) | 87 | (or (facep (quote ,arg)) |
| 86 | (error nil)) | 88 | (make-face ,arg)) |
| 87 | (condition-case nil | 89 | (or (boundp (quote ,arg)) ; We use unquoted variants too |
| 88 | (require 'man) | 90 | (defvar ,arg (quote ,arg) ,descr)))) |
| 89 | (error nil)) | ||
| 90 | (defvar msb-menu-cond) | ||
| 91 | (defvar gud-perldb-history) | ||
| 92 | (defmacro cperl-is-face (arg) ; Takes quoted arg | ||
| 93 | (cond ((fboundp 'find-face) | ||
| 94 | `(find-face ,arg)) | ||
| 95 | (;;(and (fboundp 'face-list) | ||
| 96 | ;; (face-list)) | ||
| 97 | (fboundp 'face-list) | ||
| 98 | `(member ,arg (and (fboundp 'face-list) | ||
| 99 | (face-list)))) | ||
| 100 | (t | ||
| 101 | `(boundp ,arg)))) | ||
| 102 | (defmacro cperl-make-face (arg descr) ; Takes unquoted arg | ||
| 103 | (cond ((fboundp 'make-face) | ||
| 104 | `(make-face (quote ,arg))) | ||
| 105 | (t | ||
| 106 | `(defvar ,arg (quote ,arg) ,descr)))) | ||
| 107 | (defmacro cperl-force-face (arg descr) ; Takes unquoted arg | ||
| 108 | `(progn | ||
| 109 | (or (cperl-is-face (quote ,arg)) | ||
| 110 | (cperl-make-face ,arg ,descr)) | ||
| 111 | (or (boundp (quote ,arg)) ; We use unquoted variants too | ||
| 112 | (defvar ,arg (quote ,arg) ,descr)))) | ||
| 113 | (defmacro cperl-etags-snarf-tag (_file _line) | ||
| 114 | '(etags-snarf-tag)) | ||
| 115 | (defmacro cperl-etags-goto-tag-location (elt) | ||
| 116 | `(etags-goto-tag-location ,elt))) | ||
| 117 | 91 | ||
| 118 | (defun cperl-choose-color (&rest list) | 92 | (defun cperl-choose-color (&rest list) |
| 119 | (let (answer) | 93 | (let (answer) |
| @@ -5788,10 +5762,10 @@ indentation and initial hashes. Behaves usually outside of comment." | |||
| 5788 | font-lock-variable-name-face) ; Just to put something | 5762 | font-lock-variable-name-face) ; Just to put something |
| 5789 | t) | 5763 | t) |
| 5790 | ("\\(@\\|\\$#\\)\\(\\$+\\([a-zA-Z_:][a-zA-Z0-9_:]*\\|[^ \t\n]\\)\\)" | 5764 | ("\\(@\\|\\$#\\)\\(\\$+\\([a-zA-Z_:][a-zA-Z0-9_:]*\\|[^ \t\n]\\)\\)" |
| 5791 | (1 cperl-array-face) | 5765 | (1 'cperl-array-face) |
| 5792 | (2 font-lock-variable-name-face)) | 5766 | (2 font-lock-variable-name-face)) |
| 5793 | ("\\(%\\)\\(\\$+\\([a-zA-Z_:][a-zA-Z0-9_:]*\\|[^ \t\n]\\)\\)" | 5767 | ("\\(%\\)\\(\\$+\\([a-zA-Z_:][a-zA-Z0-9_:]*\\|[^ \t\n]\\)\\)" |
| 5794 | (1 cperl-hash-face) | 5768 | (1 'cperl-hash-face) |
| 5795 | (2 font-lock-variable-name-face)) | 5769 | (2 font-lock-variable-name-face)) |
| 5796 | ;;("\\([smy]\\|tr\\)\\([^a-z_A-Z0-9]\\)\\(\\([^\n\\]*||\\)\\)\\2") | 5770 | ;;("\\([smy]\\|tr\\)\\([^a-z_A-Z0-9]\\)\\(\\([^\n\\]*||\\)\\)\\2") |
| 5797 | ;;; Too much noise from \s* @s[ and friends | 5771 | ;;; Too much noise from \s* @s[ and friends |
| @@ -5907,10 +5881,6 @@ indentation and initial hashes. Behaves usually outside of comment." | |||
| 5907 | "Face for comments") | 5881 | "Face for comments") |
| 5908 | (cperl-force-face font-lock-function-name-face | 5882 | (cperl-force-face font-lock-function-name-face |
| 5909 | "Face for function names") | 5883 | "Face for function names") |
| 5910 | (cperl-force-face cperl-hash-face | ||
| 5911 | "Face for hashes") | ||
| 5912 | (cperl-force-face cperl-array-face | ||
| 5913 | "Face for arrays") | ||
| 5914 | ;;(defvar font-lock-constant-face 'font-lock-constant-face) | 5884 | ;;(defvar font-lock-constant-face 'font-lock-constant-face) |
| 5915 | ;;(defvar font-lock-variable-name-face 'font-lock-variable-name-face) | 5885 | ;;(defvar font-lock-variable-name-face 'font-lock-variable-name-face) |
| 5916 | ;;(or (boundp 'font-lock-type-face) | 5886 | ;;(or (boundp 'font-lock-type-face) |
| @@ -5922,16 +5892,16 @@ indentation and initial hashes. Behaves usually outside of comment." | |||
| 5922 | ;; 'cperl-nonoverridable-face | 5892 | ;; 'cperl-nonoverridable-face |
| 5923 | ;; "Face to use for data types from another group.")) | 5893 | ;; "Face to use for data types from another group.")) |
| 5924 | (if (and | 5894 | (if (and |
| 5925 | (not (cperl-is-face 'cperl-array-face)) | 5895 | (not (facep 'cperl-array-face)) |
| 5926 | (cperl-is-face 'font-lock-emphasized-face)) | 5896 | (facep 'font-lock-emphasized-face)) |
| 5927 | (copy-face 'font-lock-emphasized-face 'cperl-array-face)) | 5897 | (copy-face 'font-lock-emphasized-face 'cperl-array-face)) |
| 5928 | (if (and | 5898 | (if (and |
| 5929 | (not (cperl-is-face 'cperl-hash-face)) | 5899 | (not (facep 'cperl-hash-face)) |
| 5930 | (cperl-is-face 'font-lock-other-emphasized-face)) | 5900 | (facep 'font-lock-other-emphasized-face)) |
| 5931 | (copy-face 'font-lock-other-emphasized-face 'cperl-hash-face)) | 5901 | (copy-face 'font-lock-other-emphasized-face 'cperl-hash-face)) |
| 5932 | (if (and | 5902 | (if (and |
| 5933 | (not (cperl-is-face 'cperl-nonoverridable-face)) | 5903 | (not (facep 'cperl-nonoverridable-face)) |
| 5934 | (cperl-is-face 'font-lock-other-type-face)) | 5904 | (facep 'font-lock-other-type-face)) |
| 5935 | (copy-face 'font-lock-other-type-face 'cperl-nonoverridable-face)) | 5905 | (copy-face 'font-lock-other-type-face 'cperl-nonoverridable-face)) |
| 5936 | ;;(or (boundp 'cperl-hash-face) | 5906 | ;;(or (boundp 'cperl-hash-face) |
| 5937 | ;; (defconst cperl-hash-face | 5907 | ;; (defconst cperl-hash-face |
| @@ -5942,10 +5912,10 @@ indentation and initial hashes. Behaves usually outside of comment." | |||
| 5942 | ;; 'cperl-array-face | 5912 | ;; 'cperl-array-face |
| 5943 | ;; "Face to use for arrays.")) | 5913 | ;; "Face to use for arrays.")) |
| 5944 | (let ((background 'light)) | 5914 | (let ((background 'light)) |
| 5945 | (and (not (cperl-is-face 'font-lock-constant-face)) | 5915 | (and (not (facep 'font-lock-constant-face)) |
| 5946 | (cperl-is-face 'font-lock-reference-face) | 5916 | (facep 'font-lock-reference-face) |
| 5947 | (copy-face 'font-lock-reference-face 'font-lock-constant-face)) | 5917 | (copy-face 'font-lock-reference-face 'font-lock-constant-face)) |
| 5948 | (if (cperl-is-face 'font-lock-type-face) nil | 5918 | (if (facep 'font-lock-type-face) nil |
| 5949 | (copy-face 'default 'font-lock-type-face) | 5919 | (copy-face 'default 'font-lock-type-face) |
| 5950 | (cond | 5920 | (cond |
| 5951 | ((eq background 'light) | 5921 | ((eq background 'light) |
| @@ -5960,7 +5930,7 @@ indentation and initial hashes. Behaves usually outside of comment." | |||
| 5960 | "pink"))) | 5930 | "pink"))) |
| 5961 | (t | 5931 | (t |
| 5962 | (set-face-background 'font-lock-type-face "gray90")))) | 5932 | (set-face-background 'font-lock-type-face "gray90")))) |
| 5963 | (if (cperl-is-face 'cperl-nonoverridable-face) | 5933 | (if (facep 'cperl-nonoverridable-face) |
| 5964 | nil | 5934 | nil |
| 5965 | (copy-face 'font-lock-type-face 'cperl-nonoverridable-face) | 5935 | (copy-face 'font-lock-type-face 'cperl-nonoverridable-face) |
| 5966 | (cond | 5936 | (cond |
| @@ -5974,43 +5944,9 @@ indentation and initial hashes. Behaves usually outside of comment." | |||
| 5974 | (if (x-color-defined-p "orchid1") | 5944 | (if (x-color-defined-p "orchid1") |
| 5975 | "orchid1" | 5945 | "orchid1" |
| 5976 | "orange"))))) | 5946 | "orange"))))) |
| 5977 | ;; (if (cperl-is-face 'font-lock-other-emphasized-face) nil | 5947 | (if (facep 'font-lock-variable-name-face) nil |
| 5978 | ;; (copy-face 'bold-italic 'font-lock-other-emphasized-face) | ||
| 5979 | ;; (cond | ||
| 5980 | ;; ((eq background 'light) | ||
| 5981 | ;; (set-face-background 'font-lock-other-emphasized-face | ||
| 5982 | ;; (if (x-color-defined-p "lightyellow2") | ||
| 5983 | ;; "lightyellow2" | ||
| 5984 | ;; (if (x-color-defined-p "lightyellow") | ||
| 5985 | ;; "lightyellow" | ||
| 5986 | ;; "light yellow")))) | ||
| 5987 | ;; ((eq background 'dark) | ||
| 5988 | ;; (set-face-background 'font-lock-other-emphasized-face | ||
| 5989 | ;; (if (x-color-defined-p "navy") | ||
| 5990 | ;; "navy" | ||
| 5991 | ;; (if (x-color-defined-p "darkgreen") | ||
| 5992 | ;; "darkgreen" | ||
| 5993 | ;; "dark green")))) | ||
| 5994 | ;; (t (set-face-background 'font-lock-other-emphasized-face "gray90")))) | ||
| 5995 | ;; (if (cperl-is-face 'font-lock-emphasized-face) nil | ||
| 5996 | ;; (copy-face 'bold 'font-lock-emphasized-face) | ||
| 5997 | ;; (cond | ||
| 5998 | ;; ((eq background 'light) | ||
| 5999 | ;; (set-face-background 'font-lock-emphasized-face | ||
| 6000 | ;; (if (x-color-defined-p "lightyellow2") | ||
| 6001 | ;; "lightyellow2" | ||
| 6002 | ;; "lightyellow"))) | ||
| 6003 | ;; ((eq background 'dark) | ||
| 6004 | ;; (set-face-background 'font-lock-emphasized-face | ||
| 6005 | ;; (if (x-color-defined-p "navy") | ||
| 6006 | ;; "navy" | ||
| 6007 | ;; (if (x-color-defined-p "darkgreen") | ||
| 6008 | ;; "darkgreen" | ||
| 6009 | ;; "dark green")))) | ||
| 6010 | ;; (t (set-face-background 'font-lock-emphasized-face "gray90")))) | ||
| 6011 | (if (cperl-is-face 'font-lock-variable-name-face) nil | ||
| 6012 | (copy-face 'italic 'font-lock-variable-name-face)) | 5948 | (copy-face 'italic 'font-lock-variable-name-face)) |
| 6013 | (if (cperl-is-face 'font-lock-constant-face) nil | 5949 | (if (facep 'font-lock-constant-face) nil |
| 6014 | (copy-face 'italic 'font-lock-constant-face)))) | 5950 | (copy-face 'italic 'font-lock-constant-face)))) |
| 6015 | (setq cperl-faces-init t)) | 5951 | (setq cperl-faces-init t)) |
| 6016 | (error (message "cperl-init-faces (ignored): %s" errs)))) | 5952 | (error (message "cperl-init-faces (ignored): %s" errs)))) |
| @@ -6961,7 +6897,7 @@ Use as | |||
| 6961 | file (file-of-tag) | 6897 | file (file-of-tag) |
| 6962 | fileind (format "%s:%s" file line) | 6898 | fileind (format "%s:%s" file line) |
| 6963 | ;; Moves to beginning of the next line: | 6899 | ;; Moves to beginning of the next line: |
| 6964 | info (cperl-etags-snarf-tag file line)) | 6900 | info (etags-snarf-tag)) |
| 6965 | ;; Move back | 6901 | ;; Move back |
| 6966 | (forward-char -1) | 6902 | (forward-char -1) |
| 6967 | ;; Make new member of hierarchy name ==> file ==> pos if needed | 6903 | ;; Make new member of hierarchy name ==> file ==> pos if needed |
| @@ -7033,7 +6969,7 @@ One may build such TAGS files from CPerl mode menu." | |||
| 7033 | (if (vectorp update) | 6969 | (if (vectorp update) |
| 7034 | (progn | 6970 | (progn |
| 7035 | (find-file (elt update 0)) | 6971 | (find-file (elt update 0)) |
| 7036 | (cperl-etags-goto-tag-location (elt update 1)))) | 6972 | (etags-goto-tag-location (elt update 1)))) |
| 7037 | (if (eq update -999) (cperl-tags-hier-init t))) | 6973 | (if (eq update -999) (cperl-tags-hier-init t))) |
| 7038 | 6974 | ||
| 7039 | (defun cperl-tags-treeify (to level) | 6975 | (defun cperl-tags-treeify (to level) |