summaryrefslogtreecommitdiff
path: root/lisp/emulation/viper-init.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emulation/viper-init.el')
-rw-r--r--lisp/emulation/viper-init.el42
1 files changed, 7 insertions, 35 deletions
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el
index ea041564cce..98fd9e9f89a 100644
--- a/lisp/emulation/viper-init.el
+++ b/lisp/emulation/viper-init.el
@@ -46,21 +46,16 @@
;; Tell whether we are running as a window application or on a TTY
-(defsubst viper-device-type ()
- (if (featurep 'xemacs)
- (device-type (selected-device))
- window-system))
+(define-obsolete-function-alias 'viper-device-type 'window-system "27.1")
(defun viper-color-display-p ()
(condition-case nil
- (if (featurep 'xemacs)
- (eq (device-class (selected-device)) 'color)
- (display-color-p))
+ (display-color-p)
(error nil)))
;; in XEmacs: device-type is tty on tty and stream in batch.
(defun viper-window-display-p ()
- (and (viper-device-type) (not (memq (viper-device-type) '(tty stream pc)))))
+ (and window-system (not (memq window-system '(tty stream pc)))))
(defcustom viper-ms-style-os-p (memq system-type '(ms-dos windows-nt))
"Non-nil if Emacs is running under an MS-style OS: MS-DOS, or MS-Windows."
@@ -87,7 +82,7 @@ In all likelihood, you don't need to bother with this setting."
(cond ((viper-window-display-p))
(viper-force-faces)
((viper-color-display-p))
- (t (memq (viper-device-type) '(pc)))))
+ (t (memq window-system '(pc)))))
;;; Macros
@@ -403,15 +398,6 @@ delete the text being replaced, as in standard Vi."
;; internal var, used to remember the default cursor color of emacs frames
(defvar viper-vi-state-cursor-color nil)
-;; Frame-local variables are obsolete from Emacs 22.2 onwards, so we
-;; do it by hand with viper-frame-value (qv).
-(when (and (featurep 'xemacs)
- (fboundp 'make-variable-frame-local))
- (make-variable-frame-local 'viper-replace-overlay-cursor-color)
- (make-variable-frame-local 'viper-insert-state-cursor-color)
- (make-variable-frame-local 'viper-emacs-state-cursor-color)
- (make-variable-frame-local 'viper-vi-state-cursor-color))
-
(viper-deflocalvar viper-replace-overlay nil "")
(put 'viper-replace-overlay 'permanent-local t)
@@ -428,8 +414,7 @@ is non-nil."
:type 'string
:group 'viper)
(defcustom viper-use-replace-region-delimiters
- (or (not (viper-has-face-support-p))
- (and (featurep 'xemacs) (eq (viper-device-type) 'tty)))
+ (not (viper-has-face-support-p))
"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."
@@ -441,15 +426,6 @@ color displays. By default, the delimiters are used only on TTYs."
:type 'symbol
:group 'viper)
-;; XEmacs requires glyphs
-(when (featurep 'xemacs)
- (or (glyphp viper-replace-region-end-delimiter)
- (setq viper-replace-region-end-delimiter
- (make-glyph viper-replace-region-end-delimiter)))
- (or (glyphp viper-replace-region-start-delimiter)
- (setq viper-replace-region-start-delimiter
- (make-glyph viper-replace-region-start-delimiter))))
-
;; These are local marker that must be initialized to nil and moved with
;; `viper-move-marker-locally'
;;
@@ -949,15 +925,11 @@ Should be set in `viper-custom-file-name'."
(defun viper-restore-cursor-type ()
(condition-case nil
- (if (featurep 'xemacs)
- (set (make-local-variable 'bar-cursor) nil)
- (setq cursor-type (default-value 'cursor-type)))
+ (setq cursor-type (default-value 'cursor-type))
(error nil)))
(defun viper-set-insert-cursor-type ()
- (if (featurep 'xemacs)
- (set (make-local-variable 'bar-cursor) 2)
- (setq cursor-type '(bar . 2))))
+ (setq cursor-type '(bar . 2)))
(defun viper-ESC-keyseq-timeout ()
"Key sequence beginning with ESC and separated by no more than this many milliseconds is considered to be generated by a keyboard function key.