diff options
| author | Lars Ingebrigtsen | 2019-06-19 23:46:43 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-06-20 12:51:38 +0200 |
| commit | c2e27949d5917256bb419dcdae73566079844b4d (patch) | |
| tree | f9aad61d161533b3a4d2c66ca6c4079cd31371b2 | |
| parent | 920745eba2d6cd094da5d7958299c8a1556e78d4 (diff) | |
| download | emacs-c2e27949d5917256bb419dcdae73566079844b4d.tar.gz emacs-c2e27949d5917256bb419dcdae73566079844b4d.zip | |
Remove XEmacs support from cperl-mode
* lisp/progmodes/cperl-mode.el (condition-case)
(cperl-electric-parens-mark, cperl-del-back-ch)
(cperl-do-not-fontify, cperl-mode, cperl-find-pods-heres)
(cperl-write-tags, cperl-tags-hier-init, cperl-perldoc)
(cperl-build-manpage): Remove XEmacs support.
There's a lot of support code in here for older versions of Emacs that
could be removed, too.
| -rw-r--r-- | lisp/progmodes/cperl-mode.el | 133 |
1 files changed, 29 insertions, 104 deletions
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index ba007d67c0d..254269ddf1a 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el | |||
| @@ -113,25 +113,10 @@ | |||
| 113 | (cperl-make-face ,arg ,descr)) | 113 | (cperl-make-face ,arg ,descr)) |
| 114 | (or (boundp (quote ,arg)) ; We use unquoted variants too | 114 | (or (boundp (quote ,arg)) ; We use unquoted variants too |
| 115 | (defvar ,arg (quote ,arg) ,descr)))) | 115 | (defvar ,arg (quote ,arg) ,descr)))) |
| 116 | (if (featurep 'xemacs) | 116 | (defmacro cperl-etags-snarf-tag (_file _line) |
| 117 | (defmacro cperl-etags-snarf-tag (file line) | 117 | '(etags-snarf-tag)) |
| 118 | `(progn | 118 | (defmacro cperl-etags-goto-tag-location (elt) |
| 119 | (beginning-of-line 2) | 119 | `(etags-goto-tag-location ,elt))) |
| 120 | (list ,file ,line))) | ||
| 121 | (defmacro cperl-etags-snarf-tag (_file _line) | ||
| 122 | '(etags-snarf-tag))) | ||
| 123 | (if (featurep 'xemacs) | ||
| 124 | (defmacro cperl-etags-goto-tag-location (elt) | ||
| 125 | ;;(progn | ||
| 126 | ;; (switch-to-buffer (get-file-buffer (elt ,elt 0))) | ||
| 127 | ;; (set-buffer (get-file-buffer (elt ,elt 0))) | ||
| 128 | ;; Probably will not work due to some save-excursion??? | ||
| 129 | ;; Or save-file-position? | ||
| 130 | ;; (message "Did I get to line %s?" (elt ,elt 1)) | ||
| 131 | `(goto-line (string-to-int (elt ,elt 1)))) | ||
| 132 | ;;) | ||
| 133 | (defmacro cperl-etags-goto-tag-location (elt) | ||
| 134 | `(etags-goto-tag-location ,elt)))) | ||
| 135 | 120 | ||
| 136 | (defun cperl-choose-color (&rest list) | 121 | (defun cperl-choose-color (&rest list) |
| 137 | (let (answer) | 122 | (let (answer) |
| @@ -322,14 +307,7 @@ Can be overwritten by `cperl-hairy' if nil." | |||
| 322 | :type '(choice (const null) boolean) | 307 | :type '(choice (const null) boolean) |
| 323 | :group 'cperl-affected-by-hairy) | 308 | :group 'cperl-affected-by-hairy) |
| 324 | 309 | ||
| 325 | (defvar zmacs-regions) ; Avoid warning | 310 | (defcustom cperl-electric-parens-mark window-system |
| 326 | |||
| 327 | (defcustom cperl-electric-parens-mark | ||
| 328 | (and window-system | ||
| 329 | (or (and (boundp 'transient-mark-mode) ; For Emacs | ||
| 330 | transient-mark-mode) | ||
| 331 | (and (boundp 'zmacs-regions) ; For XEmacs | ||
| 332 | zmacs-regions))) | ||
| 333 | "Not-nil means that electric parens look for active mark. | 311 | "Not-nil means that electric parens look for active mark. |
| 334 | Default is yes if there is visual feedback on mark." | 312 | Default is yes if there is visual feedback on mark." |
| 335 | :type 'boolean | 313 | :type 'boolean |
| @@ -436,9 +414,6 @@ Font for POD headers." | |||
| 436 | :type 'face | 414 | :type 'face |
| 437 | :group 'cperl-faces) | 415 | :group 'cperl-faces) |
| 438 | 416 | ||
| 439 | ;; Some double-evaluation happened with font-locks... Needed with 21.2... | ||
| 440 | (defvar cperl-singly-quote-face (featurep 'xemacs)) | ||
| 441 | |||
| 442 | (defcustom cperl-invalid-face 'underline | 417 | (defcustom cperl-invalid-face 'underline |
| 443 | "Face for highlighting trailing whitespace." | 418 | "Face for highlighting trailing whitespace." |
| 444 | :type 'face | 419 | :type 'face |
| @@ -972,13 +947,6 @@ In regular expressions (including character classes): | |||
| 972 | 947 | ||
| 973 | ;;; Portability stuff: | 948 | ;;; Portability stuff: |
| 974 | 949 | ||
| 975 | (defmacro cperl-define-key (emacs-key definition &optional xemacs-key) | ||
| 976 | `(define-key cperl-mode-map | ||
| 977 | ,(if xemacs-key | ||
| 978 | `(if (featurep 'xemacs) ,xemacs-key ,emacs-key) | ||
| 979 | emacs-key) | ||
| 980 | ,definition)) | ||
| 981 | |||
| 982 | (defvar cperl-del-back-ch | 950 | (defvar cperl-del-back-ch |
| 983 | (car (append (where-is-internal 'delete-backward-char) | 951 | (car (append (where-is-internal 'delete-backward-char) |
| 984 | (where-is-internal 'backward-delete-char-untabify))) | 952 | (where-is-internal 'backward-delete-char-untabify))) |
| @@ -990,10 +958,6 @@ In regular expressions (including character classes): | |||
| 990 | (defun cperl-putback-char (c) ; Emacs 19 | 958 | (defun cperl-putback-char (c) ; Emacs 19 |
| 991 | (push c unread-command-events)) ; Avoid undefined warning | 959 | (push c unread-command-events)) ; Avoid undefined warning |
| 992 | 960 | ||
| 993 | (if (featurep 'xemacs) | ||
| 994 | (defun cperl-putback-char (c) ; XEmacs >= 19.12 | ||
| 995 | (push (character-to-event c) unread-command-events))) | ||
| 996 | |||
| 997 | (defvar cperl-do-not-fontify | 961 | (defvar cperl-do-not-fontify |
| 998 | ;; FIXME: This is not doing what it claims! | 962 | ;; FIXME: This is not doing what it claims! |
| 999 | (if (string< emacs-version "19.30") | 963 | (if (string< emacs-version "19.30") |
| @@ -1664,9 +1628,8 @@ or as help on variables `cperl-tips', `cperl-problems', | |||
| 1664 | (cperl-val 'cperl-info-on-command-no-prompt)) | 1628 | (cperl-val 'cperl-info-on-command-no-prompt)) |
| 1665 | (progn | 1629 | (progn |
| 1666 | ;; don't clobber the backspace binding: | 1630 | ;; don't clobber the backspace binding: |
| 1667 | (cperl-define-key "\C-hf" 'cperl-info-on-current-command [(control h) f]) | 1631 | (define-key cperl-mode-map "\C-hf" 'cperl-info-on-current-command) |
| 1668 | (cperl-define-key "\C-c\C-hf" 'cperl-info-on-command | 1632 | (define-key cperl-mode-map "\C-c\C-hf" 'cperl-info-on-command))) |
| 1669 | [(control c) (control h) f]))) | ||
| 1670 | (setq local-abbrev-table cperl-mode-abbrev-table) | 1633 | (setq local-abbrev-table cperl-mode-abbrev-table) |
| 1671 | (if (cperl-val 'cperl-electric-keywords) | 1634 | (if (cperl-val 'cperl-electric-keywords) |
| 1672 | (abbrev-mode 1)) | 1635 | (abbrev-mode 1)) |
| @@ -1685,8 +1648,6 @@ or as help on variables `cperl-tips', `cperl-problems', | |||
| 1685 | (set (make-local-variable 'paragraph-start) (concat "^$\\|" page-delimiter)) | 1648 | (set (make-local-variable 'paragraph-start) (concat "^$\\|" page-delimiter)) |
| 1686 | (set (make-local-variable 'paragraph-separate) paragraph-start) | 1649 | (set (make-local-variable 'paragraph-separate) paragraph-start) |
| 1687 | (set (make-local-variable 'paragraph-ignore-fill-prefix) t) | 1650 | (set (make-local-variable 'paragraph-ignore-fill-prefix) t) |
| 1688 | (if (featurep 'xemacs) | ||
| 1689 | (set (make-local-variable 'paren-backwards-message) t)) | ||
| 1690 | (set (make-local-variable 'indent-line-function) #'cperl-indent-line) | 1651 | (set (make-local-variable 'indent-line-function) #'cperl-indent-line) |
| 1691 | (set (make-local-variable 'require-final-newline) mode-require-final-newline) | 1652 | (set (make-local-variable 'require-final-newline) mode-require-final-newline) |
| 1692 | (set (make-local-variable 'comment-start) "# ") | 1653 | (set (make-local-variable 'comment-start) "# ") |
| @@ -1717,11 +1678,6 @@ or as help on variables `cperl-tips', `cperl-problems', | |||
| 1717 | (set (make-local-variable 'imenu-sort-function) nil) | 1678 | (set (make-local-variable 'imenu-sort-function) nil) |
| 1718 | (set (make-local-variable 'vc-rcs-header) cperl-vc-rcs-header) | 1679 | (set (make-local-variable 'vc-rcs-header) cperl-vc-rcs-header) |
| 1719 | (set (make-local-variable 'vc-sccs-header) cperl-vc-sccs-header) | 1680 | (set (make-local-variable 'vc-sccs-header) cperl-vc-sccs-header) |
| 1720 | (when (featurep 'xemacs) | ||
| 1721 | ;; This one is obsolete... | ||
| 1722 | (set (make-local-variable 'vc-header-alist) | ||
| 1723 | `((SCCS ,(car cperl-vc-sccs-header)) | ||
| 1724 | (RCS ,(car cperl-vc-rcs-header))))) | ||
| 1725 | (cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x | 1681 | (cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x |
| 1726 | (set (make-local-variable 'compilation-error-regexp-alist-alist) | 1682 | (set (make-local-variable 'compilation-error-regexp-alist-alist) |
| 1727 | (cons (cons 'cperl (car cperl-compilation-error-regexp-alist)) | 1683 | (cons (cons 'cperl (car cperl-compilation-error-regexp-alist)) |
| @@ -1761,10 +1717,10 @@ or as help on variables `cperl-tips', `cperl-problems', | |||
| 1761 | (or (boundp 'font-lock-unfontify-region-function) | 1717 | (or (boundp 'font-lock-unfontify-region-function) |
| 1762 | (setq font-lock-unfontify-region-function | 1718 | (setq font-lock-unfontify-region-function |
| 1763 | #'font-lock-default-unfontify-region)) | 1719 | #'font-lock-default-unfontify-region)) |
| 1764 | (unless (featurep 'xemacs) ; Our: just a plug for wrong font-lock | 1720 | ;; Our: just a plug for wrong font-lock |
| 1765 | (set (make-local-variable 'font-lock-unfontify-region-function) | 1721 | (set (make-local-variable 'font-lock-unfontify-region-function) |
| 1766 | ;; not present with old Emacs | 1722 | ;; not present with old Emacs |
| 1767 | #'cperl-font-lock-unfontify-region-function)) | 1723 | #'cperl-font-lock-unfontify-region-function) |
| 1768 | ;; Reset syntaxification cache. | 1724 | ;; Reset syntaxification cache. |
| 1769 | (set (make-local-variable 'cperl-syntax-done-to) nil) | 1725 | (set (make-local-variable 'cperl-syntax-done-to) nil) |
| 1770 | (set (make-local-variable 'font-lock-syntactic-keywords) | 1726 | (set (make-local-variable 'font-lock-syntactic-keywords) |
| @@ -3707,14 +3663,6 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', | |||
| 3707 | indentable t)) | 3663 | indentable t)) |
| 3708 | ;; Need to remove face as well... | 3664 | ;; Need to remove face as well... |
| 3709 | (goto-char min) | 3665 | (goto-char min) |
| 3710 | ;; 'emx not supported by Emacs since at least 21.1. | ||
| 3711 | (and (featurep 'xemacs) (eq system-type 'emx) | ||
| 3712 | (eq (point) 1) | ||
| 3713 | (let ((case-fold-search t)) | ||
| 3714 | (looking-at "extproc[ \t]")) ; Analogue of #! | ||
| 3715 | (cperl-commentify min | ||
| 3716 | (point-at-eol) | ||
| 3717 | nil)) | ||
| 3718 | (while (and | 3666 | (while (and |
| 3719 | (< (point) max) | 3667 | (< (point) max) |
| 3720 | (re-search-forward search max t)) | 3668 | (re-search-forward search max t)) |
| @@ -6933,15 +6881,14 @@ Use as | |||
| 6933 | (or topdir | 6881 | (or topdir |
| 6934 | (setq topdir default-directory)) | 6882 | (setq topdir default-directory)) |
| 6935 | (let ((tags-file-name "TAGS") | 6883 | (let ((tags-file-name "TAGS") |
| 6936 | (case-fold-search (and (featurep 'xemacs) (eq system-type 'emx))) | 6884 | (case-fold-search nil) |
| 6937 | xs rel) | 6885 | xs rel) |
| 6938 | (save-excursion | 6886 | (save-excursion |
| 6939 | (cond (inbuffer nil) ; Already there | 6887 | (cond (inbuffer nil) ; Already there |
| 6940 | ((file-exists-p tags-file-name) | 6888 | ((file-exists-p tags-file-name) |
| 6941 | (if (featurep 'xemacs) | 6889 | (visit-tags-table-buffer tags-file-name)) |
| 6942 | (visit-tags-table-buffer) | 6890 | (t |
| 6943 | (visit-tags-table-buffer tags-file-name))) | 6891 | (set-buffer (find-file-noselect tags-file-name)))) |
| 6944 | (t (set-buffer (find-file-noselect tags-file-name)))) | ||
| 6945 | (cond | 6892 | (cond |
| 6946 | (dir | 6893 | (dir |
| 6947 | (cond ((eq erase 'ignore)) | 6894 | (cond ((eq erase 'ignore)) |
| @@ -7081,24 +7028,16 @@ One may build such TAGS files from CPerl mode menu." | |||
| 7081 | to l1 l2 l3) | 7028 | to l1 l2 l3) |
| 7082 | ;; (setq cperl-hierarchy '(() () ())) ; Would write into '() later! | 7029 | ;; (setq cperl-hierarchy '(() () ())) ; Would write into '() later! |
| 7083 | (setq cperl-hierarchy (list l1 l2 l3)) | 7030 | (setq cperl-hierarchy (list l1 l2 l3)) |
| 7084 | (if (featurep 'xemacs) ; Not checked | 7031 | (or tags-table-list |
| 7085 | (progn | 7032 | (call-interactively 'visit-tags-table)) |
| 7086 | (or tags-file-name | 7033 | (mapc |
| 7087 | ;; Does this work in XEmacs? | 7034 | (function |
| 7088 | (call-interactively 'visit-tags-table)) | 7035 | (lambda (tagsfile) |
| 7089 | (message "Updating list of classes...") | 7036 | (message "Updating list of classes... %s" tagsfile) |
| 7090 | (set-buffer (get-file-buffer tags-file-name)) | 7037 | (set-buffer (get-file-buffer tagsfile)) |
| 7091 | (cperl-tags-hier-fill)) | 7038 | (cperl-tags-hier-fill))) |
| 7092 | (or tags-table-list | 7039 | tags-table-list) |
| 7093 | (call-interactively 'visit-tags-table)) | 7040 | (message "Updating list of classes... postprocessing...") |
| 7094 | (mapc | ||
| 7095 | (function | ||
| 7096 | (lambda (tagsfile) | ||
| 7097 | (message "Updating list of classes... %s" tagsfile) | ||
| 7098 | (set-buffer (get-file-buffer tagsfile)) | ||
| 7099 | (cperl-tags-hier-fill))) | ||
| 7100 | tags-table-list) | ||
| 7101 | (message "Updating list of classes... postprocessing...")) | ||
| 7102 | (mapc remover (car cperl-hierarchy)) | 7041 | (mapc remover (car cperl-hierarchy)) |
| 7103 | (mapc remover (nth 1 cperl-hierarchy)) | 7042 | (mapc remover (nth 1 cperl-hierarchy)) |
| 7104 | (setq to (list nil (cons "Packages: " (nth 1 cperl-hierarchy)) | 7043 | (setq to (list nil (cons "Packages: " (nth 1 cperl-hierarchy)) |
| @@ -8450,15 +8389,7 @@ the appropriate statement modifier." | |||
| 8450 | 'variable-documentation)))) | 8389 | 'variable-documentation)))) |
| 8451 | (Man-switches "") | 8390 | (Man-switches "") |
| 8452 | (manual-program (if is-func "perldoc -f" "perldoc"))) | 8391 | (manual-program (if is-func "perldoc -f" "perldoc"))) |
| 8453 | (cond | 8392 | (Man-getpage-in-background word))) |
| 8454 | ((featurep 'xemacs) | ||
| 8455 | (defvar Manual-program) | ||
| 8456 | (defvar Manual-switches) | ||
| 8457 | (let ((Manual-program "perldoc") | ||
| 8458 | (Manual-switches (if is-func (list "-f")))) | ||
| 8459 | (manual-entry word))) | ||
| 8460 | (t | ||
| 8461 | (Man-getpage-in-background word))))) | ||
| 8462 | 8393 | ||
| 8463 | ;;;###autoload | 8394 | ;;;###autoload |
| 8464 | (defun cperl-perldoc-at-point () | 8395 | (defun cperl-perldoc-at-point () |
| @@ -8493,15 +8424,9 @@ the appropriate statement modifier." | |||
| 8493 | "Create a virtual manpage in Emacs from the POD in the file." | 8424 | "Create a virtual manpage in Emacs from the POD in the file." |
| 8494 | (interactive) | 8425 | (interactive) |
| 8495 | (require 'man) | 8426 | (require 'man) |
| 8496 | (cond | 8427 | (let ((manual-program "perldoc") |
| 8497 | ((featurep 'xemacs) | 8428 | (Man-switches "")) |
| 8498 | (defvar Manual-program) | 8429 | (Man-getpage-in-background buffer-file-name))) |
| 8499 | (let ((Manual-program "perldoc")) | ||
| 8500 | (manual-entry buffer-file-name))) | ||
| 8501 | (t | ||
| 8502 | (let* ((manual-program "perldoc") | ||
| 8503 | (Man-switches "")) | ||
| 8504 | (Man-getpage-in-background buffer-file-name))))) | ||
| 8505 | 8430 | ||
| 8506 | (defun cperl-pod2man-build-command () | 8431 | (defun cperl-pod2man-build-command () |
| 8507 | "Builds the entire background manpage and cleaning command." | 8432 | "Builds the entire background manpage and cleaning command." |