changeset 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 7d711fbfe5b5
children 3b291390be13
files lisp/ChangeLog lisp/calc/calc-ext.el lisp/calc/calc.el lisp/emulation/tpu-mapper.el lisp/ielm.el lisp/progmodes/cperl-mode.el lisp/ps-print.el
diffstat 7 files changed, 85 insertions(+), 81 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Oct 29 13:56:39 2007 +0000
+++ b/lisp/ChangeLog	Mon Oct 29 15:33:04 2007 +0000
@@ -1,3 +1,27 @@
+2007-10-29  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* 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.
+
 2007-10-29  Drew Adams  <drew.adams@oracle.com>
 
 	* faces.el (read-color): New function.
--- a/lisp/calc/calc-ext.el	Mon Oct 29 13:56:39 2007 +0000
+++ b/lisp/calc/calc-ext.el	Mon Oct 29 15:33:04 2007 +0000
@@ -1782,8 +1782,8 @@
 ;;; User menu.
 
 (defun calc-user-key-map ()
-  (if calc-emacs-type-lucid
-      (error "User-defined keys are not supported in Lucid Emacs"))
+  (if (featurep 'xemacs)
+      (error "User-defined keys are not supported in XEmacs"))
   (let ((res (cdr (lookup-key calc-mode-map "z"))))
     (if (eq (car (car res)) 27)
 	(cdr res)
--- a/lisp/calc/calc.el	Mon Oct 29 13:56:39 2007 +0000
+++ b/lisp/calc/calc.el	Mon Oct 29 15:33:04 2007 +0000
@@ -821,9 +821,6 @@
 (defvar calc-embedded-mode-hook nil
   "Hook run when starting embedded mode.")
 
-;; Verify that Calc is running on the right kind of system.
-(defvar calc-emacs-type-lucid (not (not (string-match "Lucid" emacs-version))))
-
 ;; Set up the autoloading linkage.
 (let ((name (and (fboundp 'calc-dispatch)
 		   (eq (car-safe (symbol-function 'calc-dispatch)) 'autoload)
@@ -968,7 +965,7 @@
 
 (defvar calc-digit-map
   (let ((map (make-keymap)))
-    (if calc-emacs-type-lucid
+    (if (featurep 'xemacs)
 	(map-keymap (function
 		     (lambda (keys bind)
 		       (define-key map keys
@@ -999,7 +996,7 @@
 	      (define-key calc-mode-map x 'calc-pop)
 	      (define-key calc-mode-map
 		  (if (vectorp x)
-		      (if calc-emacs-type-lucid
+		      (if (featurep 'xemacs)
 			  (if (= (length x) 1)
 			      (vector (if (consp (aref x 0))
 					  (cons 'meta (aref x 0))
@@ -2109,13 +2106,13 @@
 	    (calc-prev-char nil)
 	    (calc-prev-prev-char nil)
 	    (calc-buffer (current-buffer))
-	    (buf (if calc-emacs-type-lucid
+	    (buf (if (featurep 'xemacs)
 		     (catch 'calc-foo
 		       (catch 'execute-kbd-macro
 			 (throw 'calc-foo
 				(read-from-minibuffer
 				 "Calc: " "" calc-digit-map)))
-		       (error "Lucid Emacs requires RET after %s"
+		       (error "XEmacs requires RET after %s"
 			      "digit entry in kbd macro"))
 		   (let ((old-esc (lookup-key global-map "\e")))
 		     (unwind-protect
@@ -3646,7 +3643,7 @@
 ;;; Functions needed for Lucid Emacs support.
 
 (defun calc-read-key (&optional optkey)
-  (cond (calc-emacs-type-lucid
+  (cond ((featurep 'xemacs)
 	 (let ((event (next-command-event)))
 	   (let ((key (event-to-character event t t)))
 	     (or key optkey (error "Expected a plain keystroke"))
@@ -3664,7 +3661,7 @@
 
 (defun calc-clear-unread-commands ()
   (if (featurep 'xemacs)
-	(calc-emacs-type-lucid (setq unread-command-event nil))
+      (setq unread-command-event nil)
     (setq unread-command-events nil)))
 
 (when calc-always-load-extensions
--- a/lisp/emulation/tpu-mapper.el	Mon Oct 29 13:56:39 2007 +0000
+++ b/lisp/emulation/tpu-mapper.el	Mon Oct 29 15:33:04 2007 +0000
@@ -78,13 +78,6 @@
 
 
 ;;;
-;;;  Decide whether we're running Lucid Emacs or Emacs itself.
-;;;
-(defconst tpu-lucid-emacs19-p (string-match "Lucid" emacs-version)
-  "Non-nil if we are running Lucid Emacs version 19.")
-
-
-;;;
 ;;;  Key variables
 ;;;
 (defvar tpu-kp4 nil)
@@ -100,7 +93,7 @@
 ;;;
 ;;;  Make sure the window is big enough to display the instructions
 ;;;
-(if tpu-lucid-emacs19-p (set-screen-size (selected-screen) 80 36)
+(if (featurep 'xemacs) (set-screen-size (selected-screen) 80 36)
   (set-frame-size (selected-frame) 80 36))
 
 
@@ -167,7 +160,7 @@
 ;;;  Save <CR> for future reference
 ;;;
 (cond
- (tpu-lucid-emacs19-p
+ ((featurep 'xemacs)
   (setq tpu-return-seq (read-key-sequence "Hit carriage-return <CR> to continue "))
   (setq tpu-return (concat "[" (format "%s" (event-key (aref tpu-return-seq 0))) "]")))
  (t
@@ -179,41 +172,36 @@
 ;;;
 ;;;  Key mapping functions
 ;;;
-(defun tpu-lucid-map-key (ident descrip func gold-func)
-  (interactive)
-  (setq tpu-key-seq (read-key-sequence (format "Press %s%s: " ident descrip)))
-  (setq tpu-key (concat "[" (format "%s" (event-key (aref tpu-key-seq 0))) "]"))
-  (cond ((not (equal tpu-key tpu-return))
-	 (set-buffer "Keys")
-	 (insert (format"(global-set-key %s %s)\n" tpu-key func))
-	 (set-buffer "Gold-Keys")
-	 (insert (format "(define-key GOLD-map %s %s)\n" tpu-key gold-func))
-	 (set-buffer "Directions"))
-	;; bogosity to get next prompt to come up, if the user hits <CR>!
-	;; check periodically to see if this is still needed...
-	(t
-	 (format "%s" tpu-key)))
-  tpu-key)
-
-(defun tpu-emacs-map-key (ident descrip func gold-func)
+(defun tpu-map-key (ident descrip func gold-func)
   (interactive)
-  (message "Press %s%s: " ident descrip)
-  (setq tpu-key-seq (read-event))
-  (setq tpu-key (concat "[" (format "%s" tpu-key-seq) "]"))
-  (cond ((not (equal tpu-key tpu-return))
-	 (set-buffer "Keys")
-	 (insert (format"(define-key tpu-global-map %s %s)\n" tpu-key func))
-	 (set-buffer "Gold-Keys")
-	 (insert (format "(define-key tpu-gold-map %s %s)\n" tpu-key gold-func))
-	 (set-buffer "Directions"))
-	;; bogosity to get next prompt to come up, if the user hits <CR>!
-	;; check periodically to see if this is still needed...
-	(t
-	 (format "%s" tpu-key)))
-  tpu-key)
-
-(fset 'tpu-map-key (if tpu-lucid-emacs19-p 'tpu-lucid-map-key 'tpu-emacs-map-key))
-
+  (if (featurep 'xemacs)
+      (progn
+	(setq tpu-key-seq (read-key-sequence (format "Press %s%s: " ident descrip)))
+	(setq tpu-key (concat "[" (format "%s" (event-key (aref tpu-key-seq 0))) "]"))
+	(cond ((not (equal tpu-key tpu-return))
+	       (set-buffer "Keys")
+	       (insert (format"(global-set-key %s %s)\n" tpu-key func))
+	       (set-buffer "Gold-Keys")
+	       (insert (format "(define-key GOLD-map %s %s)\n" tpu-key gold-func))
+	       (set-buffer "Directions"))
+	      ;; bogosity to get next prompt to come up, if the user hits <CR>!
+	      ;; check periodically to see if this is still needed...
+	      (t
+	       (format "%s" tpu-key))))
+    (message "Press %s%s: " ident descrip)
+    (setq tpu-key-seq (read-event))
+    (setq tpu-key (concat "[" (format "%s" tpu-key-seq) "]"))
+    (cond ((not (equal tpu-key tpu-return))
+	   (set-buffer "Keys")
+	   (insert (format"(define-key tpu-global-map %s %s)\n" tpu-key func))
+	   (set-buffer "Gold-Keys")
+	   (insert (format "(define-key tpu-gold-map %s %s)\n" tpu-key gold-func))
+	   (set-buffer "Directions"))
+	  ;; bogosity to get next prompt to come up, if the user hits <CR>!
+	  ;; check periodically to see if this is still needed...
+	  (t
+	   (format "%s" tpu-key))))
+    tpu-key)
 
 (set-buffer "Keys")
 (insert "
@@ -350,7 +338,7 @@
 ;;
 ")
 
-(cond (tpu-lucid-emacs19-p
+(cond ((featurep 'xemacs)
        (insert (format "(setq tpu-help-enter \"%s\")\n" tpu-enter-seq))
        (insert (format "(setq tpu-help-return \"%s\")\n" tpu-return-seq))
        (insert "(setq tpu-help-N \"[#<keypress-event N>]\")\n")
@@ -368,7 +356,7 @@
 ;;;
 (let ((file
        (convert-standard-filename
-	(if tpu-lucid-emacs19-p "~/.tpu-lucid-keys" "~/.tpu-keys"))))
+	(if (featurep 'xemacs) "~/.tpu-lucid-keys" "~/.tpu-keys"))))
   (set-visited-file-name
    (read-file-name (format "Save key mapping to file (default %s): " file) "" file)))
 (save-buffer)
--- a/lisp/ielm.el	Mon Oct 29 13:56:39 2007 +0000
+++ b/lisp/ielm.el	Mon Oct 29 15:33:04 2007 +0000
@@ -169,7 +169,7 @@
 
 (defvar ielm-map nil)
 (if ielm-map nil
-  (if (string-match "Lucid" emacs-version)
+  (if (featurep 'xemacs)
       ;; Lemacs
       (progn
 	(setq ielm-map (make-sparse-keymap))
--- 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
--- a/lisp/ps-print.el	Mon Oct 29 13:56:39 2007 +0000
+++ b/lisp/ps-print.el	Mon Oct 29 15:33:04 2007 +0000
@@ -1464,10 +1464,6 @@
 
 (let ((case-fold-search t))
   (cond ((featurep 'xemacs))
-	((string-match "Lucid" emacs-version)
-	 (error "`ps-print' doesn't support Lucid"))
-	((string-match "Epoch" emacs-version)
-	 (error "`ps-print' doesn't support Epoch"))
 	(t
 	 (unless (and (boundp 'emacs-major-version)
 		      (>= emacs-major-version 22))