summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-10-04 14:44:34 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-10-04 14:44:34 +0200
commit1039c2e2eb14d5016b9178aaa656c7d1759723d5 (patch)
treecb24d874352910a7689cdad9c5f3cb80479a899d
parent07959a0ffbb585931d1d62c266e83d79931cc561 (diff)
downloademacs-1039c2e2eb14d5016b9178aaa656c7d1759723d5.tar.gz
Remove some more XEmacs compat code from viper*.el
* lisp/emulation/viper-ex.el (viper-ex-read-file-name): Ditto. * lisp/emulation/viper-init.el (viper-ms-style-os-p) (viper-has-face-support-p, viper-deactivate-input-method) (viper-activate-input-method, viper-set-input-method): Ditto. * lisp/emulation/viper-util.el (viper-get-saved-cursor-color-in-replace-mode) (viper-get-saved-cursor-color-in-insert-mode) (viper-get-saved-cursor-color-in-emacs-mode) (viper-set-replace-overlay, viper-key-to-emacs-key) (viper-set-unread-command-events): Ditto. * lisp/emulation/viper.el (viper-go-away, viper-set-hooks) (viper-non-hook-settings): Remove XEmacs compat code.
-rw-r--r--lisp/emulation/viper-ex.el5
-rw-r--r--lisp/emulation/viper-init.el35
-rw-r--r--lisp/emulation/viper-util.el75
-rw-r--r--lisp/emulation/viper.el18
4 files changed, 43 insertions, 90 deletions
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el
index 26bca686cb3..6df6a55b4c5 100644
--- a/lisp/emulation/viper-ex.el
+++ b/lisp/emulation/viper-ex.el
@@ -1101,10 +1101,7 @@ reversed."
(copy-keymap minibuffer-local-completion-map))
beg end cont val)
- (viper-add-keymap ex-read-filename-map
- (if (featurep 'emacs)
- minibuffer-local-completion-map
- read-file-name-map))
+ (viper-add-keymap ex-read-filename-map minibuffer-local-completion-map)
(setq cont (setq viper-keep-reading-filename t))
(while cont
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el
index 5a80804e757..ea041564cce 100644
--- a/lisp/emulation/viper-init.el
+++ b/lisp/emulation/viper-init.el
@@ -62,9 +62,7 @@
(defun viper-window-display-p ()
(and (viper-device-type) (not (memq (viper-device-type) '(tty stream pc)))))
-(defcustom viper-ms-style-os-p
- (memq system-type (if (featurep 'emacs) '(ms-dos windows-nt)
- '(ms-dos windows-nt windows-95)))
+(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."
:type 'boolean
:tag "Is it Microsoft-made OS?"
@@ -89,8 +87,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))
- ((featurep 'emacs) (memq (viper-device-type) '(pc)))
- ((featurep 'xemacs) (memq (viper-device-type) '(tty pc)))))
+ (t (memq (viper-device-type) '(pc)))))
;;; Macros
@@ -334,25 +331,12 @@ Use `\\[viper-set-expert-level]' to change this.")
(or current-input-method default-input-method))
"")))))
-(defun viper-deactivate-input-method ()
- (cond ((and (featurep 'emacs) (fboundp 'deactivate-input-method))
- (deactivate-input-method))
- ((and (featurep 'xemacs) (boundp 'current-input-method))
- ;; XEmacs had broken quail-mode for some time, so we are working around
- ;; it here
- (setq quail-mode nil)
- (if (featurep 'quail)
- (quail-delete-overlays))
- (setq describe-current-input-method-function nil)
- (setq current-input-method nil)
- (run-hooks 'input-method-deactivate-hook)
- (force-mode-line-update))
- ))
+(define-obsolete-function-alias 'viper-deactivate-input-method
+ #'deactivate-input-method "27.1")
+
(defun viper-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)))))
+ (declare (obsolete activate-input-method "27.1"))
+ (activate-input-method default-input-method))
;; Set quail-mode to ARG
(defun viper-set-input-method (arg)
@@ -360,10 +344,9 @@ Use `\\[viper-set-expert-level]' to change this.")
(let (viper-mule-hook-flag) ; temporarily deactivate viper mule hooks
(cond ((and arg (> (prefix-numeric-value arg) 0) default-input-method)
;; activate input method
- (viper-activate-input-method))
+ (activate-input-method default-input-method))
(t ; deactivate input method
- (viper-deactivate-input-method)))
- ))
+ (deactivate-input-method)))))
;; VI-style Undo
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index 1d7bb1580ce..046cee9912c 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -166,30 +166,21 @@ Otherwise return the normal value."
(defun viper-get-saved-cursor-color-in-replace-mode ()
(or
- (funcall
- (if (featurep 'emacs) 'frame-parameter 'frame-property)
- (selected-frame)
- 'viper-saved-cursor-color-in-replace-mode)
+ (frame-parameter (selected-frame) 'viper-saved-cursor-color-in-replace-mode)
(or (and (eq viper-current-state 'emacs-mode)
(viper-frame-value viper-emacs-state-cursor-color))
(viper-frame-value viper-vi-state-cursor-color))))
(defun viper-get-saved-cursor-color-in-insert-mode ()
(or
- (funcall
- (if (featurep 'emacs) 'frame-parameter 'frame-property)
- (selected-frame)
- 'viper-saved-cursor-color-in-insert-mode)
+ (frame-parameter (selected-frame) 'viper-saved-cursor-color-in-insert-mode)
(or (and (eq viper-current-state 'emacs-mode)
(viper-frame-value viper-emacs-state-cursor-color))
(viper-frame-value viper-vi-state-cursor-color))))
(defun viper-get-saved-cursor-color-in-emacs-mode ()
(or
- (funcall
- (if (featurep 'emacs) 'frame-parameter 'frame-property)
- (selected-frame)
- 'viper-saved-cursor-color-in-emacs-mode)
+ (frame-parameter (selected-frame) 'viper-saved-cursor-color-in-emacs-mode)
(viper-frame-value viper-vi-state-cursor-color)))
;; restore cursor color from replace overlay
@@ -738,8 +729,7 @@ Otherwise return the normal value."
(viper-move-replace-overlay beg end)
(setq viper-replace-overlay (make-overlay beg end (current-buffer)))
;; never detach
- (overlay-put
- viper-replace-overlay (if (featurep 'emacs) 'evaporate 'detachable) nil)
+ (overlay-put viper-replace-overlay 'evaporate nil)
(overlay-put
viper-replace-overlay 'priority viper-replace-overlay-priority)
;; If Emacs will start supporting overlay maps, as it currently supports
@@ -939,10 +929,10 @@ Otherwise return the normal value."
(string-to-char key-name))
;; Emacs doesn't recognize `return' and `escape' as events on
;; dumb terminals, so we translate them into characters
- ((and (featurep 'emacs) (not (viper-window-display-p))
+ ((and (not (viper-window-display-p))
(string= key-name "return"))
?\C-m)
- ((and (featurep 'emacs) (not (viper-window-display-p))
+ ((and (not (viper-window-display-p))
(string= key-name "escape"))
?\e)
;; pass symbol-event as is
@@ -978,41 +968,28 @@ Otherwise return the normal value."
(define-obsolete-function-alias 'viper-eventify-list-xemacs 'ignore "27.1")
-;; Smooths out the difference between Emacs's unread-command-events
-;; and XEmacs unread-command-event. Arg is a character, an event, a list of
-;; events or a sequence of keys.
+;; Arg is a character, an event, a list of events or a sequence of
+;; keys.
;;
-;; Due to the way unread-command-events in Emacs (not XEmacs), a non-event
-;; symbol in unread-command-events list may cause Emacs to turn this symbol
-;; into an event. Below, we delete nil from event lists, since nil is the most
-;; common symbol that might appear in this wrong context.
+;; Due to the way unread-command-events works in Emacs, a non-event
+;; symbol in unread-command-events list may cause Emacs to turn this
+;; symbol into an event. Below, we delete nil from event lists, since
+;; nil is the most common symbol that might appear in this wrong
+;; context.
(defun viper-set-unread-command-events (arg)
- (if (featurep 'emacs)
- (setq
- unread-command-events
- (let ((new-events
- (cond ((eventp arg) (list arg))
- ((listp arg) arg)
- ((sequencep arg)
- (listify-key-sequence arg))
- (t (error
- "viper-set-unread-command-events: Invalid argument, %S"
- arg)))))
- (if (not (eventp nil))
- (setq new-events (delq nil new-events)))
- (append new-events unread-command-events)))
- ;; XEmacs
- (setq
- unread-command-events
- (append
- (cond ((characterp arg) (list (character-to-event arg)))
- ((eventp arg) (list arg))
- ((stringp arg) (mapcar 'character-to-event arg))
- ((vectorp arg) (append arg nil)) ; turn into list
- ((listp arg) nil)
- (t (error
- "viper-set-unread-command-events: Invalid argument, %S" arg)))
- unread-command-events))))
+ (setq
+ unread-command-events
+ (let ((new-events
+ (cond ((eventp arg) (list arg))
+ ((listp arg) arg)
+ ((sequencep arg)
+ (listify-key-sequence arg))
+ (t (error
+ "viper-set-unread-command-events: Invalid argument, %S"
+ arg)))))
+ (if (not (eventp nil))
+ (setq new-events (delq nil new-events)))
+ (append new-events unread-command-events))))
;; Check if vec is a vector of key-press events representing characters
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index 0f5c92c2c9e..7297d998860 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -689,11 +689,10 @@ It also can't undo some Viper settings."
(viper-standard-value 'major-mode
viper-saved-non-viper-variables))
- (if (featurep 'emacs)
- (setq-default
- mark-even-if-inactive
- (viper-standard-value
- 'mark-even-if-inactive viper-saved-non-viper-variables)))
+ (setq-default
+ mark-even-if-inactive
+ (viper-standard-value
+ 'mark-even-if-inactive viper-saved-non-viper-variables))
;; Ideally, we would like to be able to de-localize local variables
(unless
@@ -1018,7 +1017,7 @@ Two differences:
(lambda (orig-fun &rest args)
"Adjust input-method toggling in vi-state."
(if (and viper-special-input-method (eq viper-current-state 'vi-state))
- (viper-deactivate-input-method)
+ (deactivate-input-method)
(apply orig-fun args))))
) ; viper-set-hooks
@@ -1035,8 +1034,7 @@ Two differences:
require-final-newline t)
;; don't bark when mark is inactive
- (if (featurep 'emacs)
- (setq mark-even-if-inactive t))
+ (setq mark-even-if-inactive t)
(setq scroll-step 1)
@@ -1134,9 +1132,7 @@ These two lines must come in the order given."))
(cons 'mode-line-buffer-identification
(list (default-value 'mode-line-buffer-identification)))
(cons 'global-mode-string (list global-mode-string))
- (if (featurep 'emacs)
- (cons 'mark-even-if-inactive (list mark-even-if-inactive)))
- )))
+ (cons 'mark-even-if-inactive (list mark-even-if-inactive)))))
;; Set some useful macros, advices