diff lisp/emulation/viper-init.el @ 91085:880960b70474

Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-283
author Miles Bader <miles@gnu.org>
date Sun, 11 Nov 2007 00:56:44 +0000
parents 4bc33ffdda1a 51aa47312c4b
children 53108e6cea98
line wrap: on
line diff
--- a/lisp/emulation/viper-init.el	Fri Nov 09 14:52:32 2007 +0000
+++ b/lisp/emulation/viper-init.el	Sun Nov 11 00:56:44 2007 +0000
@@ -49,10 +49,6 @@
   (interactive)
   (message "Viper version is %s" viper-version))
 
-;; Is it XEmacs?
-(defconst viper-xemacs-p (featurep 'xemacs))
-;; Is it Emacs?
-(defconst viper-emacs-p (not viper-xemacs-p))
 ;; Tell whether we are running as a window application or on a TTY
 
 ;; This is used to avoid compilation warnings. When emacs/xemacs forms can
@@ -116,8 +112,8 @@
   (cond ((viper-window-display-p))
 	(viper-force-faces)
 	((viper-color-display-p))
-	(viper-emacs-p (memq (viper-device-type) '(pc)))
-	(viper-xemacs-p (memq (viper-device-type) '(tty pc)))))
+	((featurep 'emacs) (memq (viper-device-type) '(pc)))
+	((featurep 'xemacs) (memq (viper-device-type) '(tty pc)))))
 
 
 ;;; Macros
@@ -356,9 +352,9 @@
 		   "")))))
 
 (defun viper-inactivate-input-method ()
-  (cond ((and viper-emacs-p (fboundp 'inactivate-input-method))
+  (cond ((and (featurep 'emacs) (fboundp 'inactivate-input-method))
 	 (inactivate-input-method))
-	((and viper-xemacs-p (boundp 'current-input-method))
+	((and (featurep 'xemacs) (boundp 'current-input-method))
 	 ;; XEmacs had broken quil-mode for some time, so we are working around
 	 ;; it here
 	 (setq quail-mode nil)
@@ -370,7 +366,7 @@
 	 (force-mode-line-update))
 	))
 (defun viper-activate-input-method ()
-  (cond ((and viper-emacs-p (fboundp 'activate-input-method))
+  (cond ((and (featurep 'emacs) (fboundp 'activate-input-method))
 	 (activate-input-method default-input-method))
 	((featurep 'xemacs)
 	 (if (fboundp 'quail-mode) (quail-mode 1)))))
@@ -475,7 +471,7 @@
   :group 'viper)
 (defcustom viper-use-replace-region-delimiters
   (or (not (viper-has-face-support-p))
-      (and viper-xemacs-p (eq (viper-device-type) 'tty)))
+      (and (featurep 'xemacs) (eq (viper-device-type) 'tty)))
   "*If non-nil, Viper will always use `viper-replace-region-end-delimiter' and
 `viper-replace-region-start-delimiter' to delimit replacement regions, even on
 color displays.  By default, the delimiters are used only on TTYs."
@@ -1018,13 +1014,13 @@
 
 (defun viper-restore-cursor-type ()
   (condition-case nil
-      (if viper-xemacs-p
+      (if (featurep 'xemacs)
 	  (set (make-local-variable 'bar-cursor) nil)
 	(setq cursor-type default-cursor-type))
     (error nil)))
 
 (defun viper-set-insert-cursor-type ()
-  (if viper-xemacs-p
+  (if (featurep 'xemacs)
       (set (make-local-variable 'bar-cursor) 2)
     (setq cursor-type '(bar . 2))))