diff lisp/progmodes/cperl-mode.el @ 85762:29e75576e47f

* calc/calc.el (calc-emacs-type-lucid): Remove. (calc-digit-map, calcDigit-start, calc-read-key) (calc-clear-unread-commands): * calc/calc-ext.el (calc-user-key-map): Replace uses of calc-emacs-type-lucid with (featurep 'xemacs) * emulation/tpu-mapper.el: Replace tpu-lucid-emacs19-p with (featurep 'xemacs). (tpu-lucid-emacs19-p): Remove. (tpu-map-key): Make it a function instead of using fset. Inline tpu-emacs-map-key and tpu-lucid-map-key. Use featurep 'xemacs. (tpu-emacs-map-key, tpu-lucid-map-key): Remove. * ielm.el: Use featurep 'xemacs. * progmodes/cperl-mode.el (cperl-xemacs-p): Remove. (condition-case, cperl-can-font-lock, cperl-singly-quote-face) (cperl-define-key, cperl-mode-map, cperl-mode, cperl-init-faces) (cperl-write-tags, cperl-tags-hier-init, cperl-perldoc): Replace cperl-xemacs-p with (featurep 'xemacs). (font-lock-cache-position): Pacify byte compiler.
author Dan Nicolaescu <dann@ics.uci.edu>
date Mon, 29 Oct 2007 15:33:04 +0000
parents 455aadb38992
children 2c08ad76fc1f 880960b70474
line wrap: on
line diff
--- a/lisp/progmodes/cperl-mode.el	Mon Oct 29 13:56:39 2007 +0000
+++ b/lisp/progmodes/cperl-mode.el	Mon Oct 29 15:33:04 2007 +0000
@@ -78,9 +78,8 @@
       (condition-case nil
 	  (require 'man)
 	(error nil))
-      (defconst cperl-xemacs-p (string-match "XEmacs\\|Lucid" emacs-version))
       (defvar cperl-can-font-lock
-	(or cperl-xemacs-p
+	(or (featurep 'xemacs)
 	    (and (boundp 'emacs-major-version)
 		 (or window-system
 		     (> emacs-major-version 20)))))
@@ -131,14 +130,14 @@
 		 (cperl-make-face ,arg ,descr))
 	     (or (boundp (quote ,arg)) ; We use unquoted variants too
 		 (defvar ,arg (quote ,arg) ,descr))))
-      (if cperl-xemacs-p
+      (if (featurep 'xemacs)
 	  (defmacro cperl-etags-snarf-tag (file line)
 	    `(progn
                (beginning-of-line 2)
                (list ,file ,line)))
 	(defmacro cperl-etags-snarf-tag (file line)
 	  `(etags-snarf-tag)))
-      (if cperl-xemacs-p
+      (if (featurep 'xemacs)
 	  (defmacro cperl-etags-goto-tag-location (elt)
 	    ;;(progn
             ;; (switch-to-buffer (get-file-buffer (elt ,elt 0)))
@@ -151,10 +150,8 @@
 	(defmacro cperl-etags-goto-tag-location (elt)
 	  `(etags-goto-tag-location ,elt))))
 
-(defconst cperl-xemacs-p (string-match "XEmacs\\|Lucid" emacs-version))
-
 (defvar cperl-can-font-lock
-  (or cperl-xemacs-p
+  (or (featurep 'xemacs)
       (and (boundp 'emacs-major-version)
 	   (or window-system
 	       (> emacs-major-version 20)))))
@@ -458,7 +455,7 @@
   :group 'cperl-faces)
 
 ;;; Some double-evaluation happened with font-locks...  Needed with 21.2...
-(defvar cperl-singly-quote-face cperl-xemacs-p)
+(defvar cperl-singly-quote-face (featurep 'xemacs))
 
 (defcustom cperl-invalid-face 'underline
   "*Face for highlighting trailing whitespace."
@@ -1011,7 +1008,7 @@
 (defmacro cperl-define-key (emacs-key definition &optional xemacs-key)
   `(define-key cperl-mode-map
      ,(if xemacs-key
-	  `(if cperl-xemacs-p ,xemacs-key ,emacs-key)
+	  `(if (featurep 'xemacs) ,xemacs-key ,emacs-key)
 	emacs-key)
      ,definition))
 
@@ -1024,7 +1021,7 @@
      (setq cperl-del-back-ch (aref cperl-del-back-ch 0)))
 
 (defun cperl-mark-active () (mark))	; Avoid undefined warning
-(if cperl-xemacs-p
+(if (featurep 'xemacs)
     (progn
       ;; "Active regions" are on: use region only if active
       ;; "Active regions" are off: use region unconditionally
@@ -1040,7 +1037,7 @@
 (defun cperl-putback-char (c)		; Emacs 19
   (set 'unread-command-events (list c))) ; Avoid undefined warning
 
-(if cperl-xemacs-p
+(if (featurep 'xemacs)
     (defun cperl-putback-char (c)	; XEmacs >= 19.12
       (setq unread-command-events (list (eval '(character-to-event c))))))
 
@@ -1192,7 +1189,7 @@
 		      ;;(concat (char-to-string help-char) "v") ; does not work
 		      'cperl-get-help
 		      [(control c) (control h) v]))
-  (if (and cperl-xemacs-p
+  (if (and (featurep 'xemacs)
 	   (<= emacs-minor-version 11) (<= emacs-major-version 19))
       (progn
 	;; substitute-key-definition is usefulness-deenhanced...
@@ -1744,7 +1741,7 @@
   (setq paragraph-separate paragraph-start)
   (make-local-variable 'paragraph-ignore-fill-prefix)
   (setq paragraph-ignore-fill-prefix t)
-  (if cperl-xemacs-p
+  (if (featurep 'xemacs)
     (progn
       (make-local-variable 'paren-backwards-message)
       (set 'paren-backwards-message t)))
@@ -1835,7 +1832,7 @@
 	(or (boundp 'font-lock-unfontify-region-function)
 	    (set 'font-lock-unfontify-region-function
 		 'font-lock-default-unfontify-region))
-	(unless cperl-xemacs-p		; Our: just a plug for wrong font-lock
+	(unless (featurep 'xemacs)		; Our: just a plug for wrong font-lock
 	  (make-local-variable 'font-lock-unfontify-region-function)
 	  (set 'font-lock-unfontify-region-function ; not present with old Emacs
 	       'cperl-font-lock-unfontify-region-function))
@@ -5854,7 +5851,7 @@
 	   (and (fboundp 'turn-on-font-lock) ; Check for newer font-lock
 		;; not yet as of XEmacs 19.12, works with 21.1.11
 		(or
-		 (not cperl-xemacs-p)
+		 (not (featurep 'xemacs))
 		 (string< "21.1.9" emacs-version)
 		 (and (string< "21.1.10" emacs-version)
 		      (string< emacs-version "21.1.2")))
@@ -6015,7 +6012,7 @@
 	  ;;    (defconst cperl-nonoverridable-face
 	  ;;	'cperl-nonoverridable-face
 	  ;;	"Face to use for data types from another group."))
-	  ;;(if (not cperl-xemacs-p) nil
+	  ;;(if (not (featurep 'xemacs)) nil
 	  ;;  (or (boundp 'font-lock-comment-face)
 	  ;;	(defconst font-lock-comment-face
 	  ;;	  'font-lock-comment-face
@@ -6964,7 +6961,7 @@
     (save-excursion
       (cond (inbuffer nil)		; Already there
 	    ((file-exists-p tags-file-name)
-	     (if cperl-xemacs-p
+	     (if (featurep 'xemacs)
 		 (visit-tags-table-buffer)
 	       (visit-tags-table-buffer tags-file-name)))
 	    (t (set-buffer (find-file-noselect tags-file-name))))
@@ -7100,7 +7097,7 @@
 	    pack name cons1 to l1 l2 l3 l4 b)
 	;; (setq cperl-hierarchy '(() () ())) ; Would write into '() later!
 	(setq cperl-hierarchy (list l1 l2 l3))
-	(if cperl-xemacs-p		; Not checked
+	(if (featurep 'xemacs)		; Not checked
 	    (progn
 	      (or tags-file-name
 		  ;; Does this work in XEmacs?
@@ -8451,7 +8448,7 @@
 				  'variable-documentation))))
 	 (manual-program (if is-func "perldoc -f" "perldoc")))
     (cond
-     (cperl-xemacs-p
+     ((featurep 'xemacs)
       (let ((Manual-program "perldoc")
 	    (Manual-switches (if is-func (list "-f"))))
 	(manual-entry word)))
@@ -8493,7 +8490,7 @@
   (interactive)
   (require 'man)
   (cond
-   (cperl-xemacs-p
+   ((featurep 'xemacs)
     (let ((Manual-program "perldoc"))
       (manual-entry buffer-file-name)))
    (t
@@ -8689,6 +8686,8 @@
       (message "to %s:%6s,%7s" l delta tot))
     tot))
 
+(defvar font-lock-cache-position)
+
 (defun cperl-emulate-lazy-lock (&optional window-size)
   "Emulate `lazy-lock' without `condition-case', so `debug-on-error' works.
 Start fontifying the buffer from the start (or end) using the given