summaryrefslogtreecommitdiff
path: root/lisp/emulation/viper-util.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emulation/viper-util.el')
-rw-r--r--lisp/emulation/viper-util.el50
1 files changed, 13 insertions, 37 deletions
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index df33496fd8d..6d23ae9a0fd 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -29,9 +29,6 @@
;; Compiler pacifier
(defvar viper-minibuffer-current-face)
-(defvar viper-minibuffer-insert-face)
-(defvar viper-minibuffer-vi-face)
-(defvar viper-minibuffer-emacs-face)
(defvar viper-replace-overlay-face)
(defvar viper-fast-keyseq-timeout)
(defvar ex-unix-type-shell)
@@ -64,22 +61,8 @@
(define-obsolete-function-alias 'viper-iconify
#'iconify-or-deiconify-frame "27.1")
-
-;; CHAR is supposed to be a char or an integer (positive or negative)
-;; LIST is a list of chars, nil, and negative numbers
-;; Check if CHAR is a member by trying to convert in characters, if necessary.
-;; Introduced for compatibility with XEmacs, where integers are not the same as
-;; chars.
-(defun viper-memq-char (char list)
- (cond ((and (integerp char) (>= char 0))
- (memq char list))
- ((memq char list))))
-
-;; Check if char-or-int and char are the same as characters
-(defun viper-char-equal (char-or-int char)
- (cond ((and (integerp char-or-int) (>= char-or-int 0))
- (= char-or-int char))
- ((eq char-or-int char))))
+(define-obsolete-function-alias 'viper-memq-char #'memq "29.1")
+(define-obsolete-function-alias 'viper-char-equal #'eq "29.1")
;; Like =, but accommodates null and also is t for eq-objects
(defun viper= (char char1)
@@ -88,8 +71,7 @@
(= char char1))
(t nil)))
-(defsubst viper-color-display-p ()
- (x-display-color-p))
+(define-obsolete-function-alias 'viper-color-display-p #'x-display-color-p "29.1")
(defun viper-get-cursor-color (&optional _frame)
(cdr (assoc 'cursor-color (frame-parameters))))
@@ -97,9 +79,6 @@
(defmacro viper-frame-value (variable)
"Return the value of VARIABLE local to the current frame, if there is one.
Otherwise return the normal value."
- ;; Frame-local variables are obsolete from Emacs 22.2 onwards,
- ;; so we do it by hand instead.
- ;; Buffer-local values take precedence over frame-local ones.
`(if (local-variable-p ',variable)
,variable
;; Distinguish between no frame parameter and a frame parameter
@@ -110,7 +89,7 @@ Otherwise return the normal value."
;; cursor colors
(defun viper-change-cursor-color (new-color &optional frame)
- (if (and (viper-window-display-p) (viper-color-display-p)
+ (if (and (viper-window-display-p) (x-display-color-p)
(stringp new-color) (x-color-defined-p new-color)
(not (string= new-color (viper-get-cursor-color))))
(modify-frame-parameters
@@ -142,7 +121,7 @@ Otherwise return the normal value."
;; By default, saves current frame cursor color before changing viper state
(defun viper-save-cursor-color (before-which-mode)
- (if (and (viper-window-display-p) (viper-color-display-p))
+ (if (and (viper-window-display-p) (x-display-color-p))
(let ((color (viper-get-cursor-color)))
(if (and (stringp color) (x-color-defined-p color)
;; there is something fishy in that the color is not saved if
@@ -1183,25 +1162,23 @@ This option is appropriate if you like Emacs-style words."
(looking-at (concat "[" viper-strict-ALPHA-chars addl-chars "]"))
(or
;; or one of the additional chars being asked to include
- (viper-memq-char char (viper-string-to-list addl-chars))
+ (memq char (viper-string-to-list addl-chars))
(and
;; not one of the excluded word chars (note:
;; viper-non-word-characters is a list)
- (not (viper-memq-char char viper-non-word-characters))
+ (not (memq char viper-non-word-characters))
;; char of the Viper-word syntax class
- (viper-memq-char (char-syntax char)
- (viper-string-to-list viper-ALPHA-char-class))))))
- ))
+ (memq (char-syntax char)
+ (viper-string-to-list viper-ALPHA-char-class))))))))
(defun viper-looking-at-separator ()
(let ((char (char-after (point))))
(if char
(if (eq viper-syntax-preference 'strict-vi)
- (viper-memq-char char (viper-string-to-list viper-strict-SEP-chars))
+ (memq char (viper-string-to-list viper-strict-SEP-chars))
(or (eq char ?\n) ; RET is always a separator in Vi
- (viper-memq-char (char-syntax char)
- (viper-string-to-list viper-SEP-char-class)))))
- ))
+ (memq (char-syntax char)
+ (viper-string-to-list viper-SEP-char-class)))))))
(defsubst viper-looking-at-alphasep (&optional addl-chars)
(or (viper-looking-at-separator) (viper-looking-at-alpha addl-chars)))
@@ -1327,8 +1304,7 @@ This option is appropriate if you like Emacs-style words."
;; of the excluded characters
(if (and (eq syntax-of-char-looked-at ?w)
(not negated-syntax))
- (not (viper-memq-char
- char-looked-at viper-non-word-characters))
+ (not (memq char-looked-at viper-non-word-characters))
t))
(funcall skip-syntax-func 1)
0)