diff options
author | Stefan Kangas <stefan@marxist.se> | 2022-08-03 11:31:41 +0200 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2022-08-03 11:32:44 +0200 |
commit | 9b630dc252702230e1e111c1b3ee363c65ae9c32 (patch) | |
tree | db08438d8ce6418ea7516b294a4cfa5d0bd0ea67 | |
parent | 4f3e95bed523be11f3be7b791c6ae909ffa77a8d (diff) | |
download | emacs-9b630dc252702230e1e111c1b3ee363c65ae9c32.tar.gz |
Remove more XEmacs compat code from viper-util.el
* lisp/emulation/viper-util.el (viper-check-version): Remove
XEmacs compat code.
(viper-get-visible-buffer-window): Make obsolete. Update caller.
(viper-key-press-events-to-chars): Make obsolete.
-rw-r--r-- | lisp/emulation/viper-ex.el | 2 | ||||
-rw-r--r-- | lisp/emulation/viper-util.el | 41 |
2 files changed, 16 insertions, 27 deletions
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index d1bf5e38d53..ec7b1e4cac3 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el @@ -1547,7 +1547,7 @@ reversed." (if skip-rest () ;; setup buffer - (if (setq wind (viper-get-visible-buffer-window buf)) + (if (setq wind (get-buffer-window buf 'visible)) () (setq wind (get-lru-window 'visible)) (set-window-buffer wind buf)) diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index 6d23ae9a0fd..c9e4fa70d0a 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el @@ -1,6 +1,6 @@ ;;; viper-util.el --- Utilities used by viper.el -*- lexical-binding:t -*- -;; Copyright (C) 1994-1997, 1999-2022 Free Software Foundation, Inc. +;; Copyright (C) 1994-2022 Free Software Foundation, Inc. ;; Author: Michael Kifer <kifer@cs.stonybrook.edu> ;; Package: viper @@ -175,35 +175,23 @@ Otherwise return the normal value." ;; Check the current version against the major and minor version numbers -;; using op: cur-vers op major.minor If emacs-major-version or -;; emacs-minor-version are not defined, we assume that the current version -;; is hopelessly outdated. We assume that emacs-major-version and -;; emacs-minor-version are defined. Otherwise, for Emacs/XEmacs 19, if the -;; current minor version is < 10 (xemacs) or < 23 (emacs) the return value -;; will be nil (when op is =, >, or >=) and t (when op is <, <=), which may be -;; incorrect. However, this gives correct result in our cases, since we are -;; testing for sufficiently high Emacs versions. -(defun viper-check-version (op major minor &optional type-of-emacs) +;; using op: cur-vers op major.minor +(defun viper-check-version (op major minor &optional _type-of-emacs) (declare (obsolete nil "28.1")) - (if (and (boundp 'emacs-major-version) (boundp 'emacs-minor-version)) - (and (cond ((eq type-of-emacs 'xemacs) (featurep 'xemacs)) - ((eq type-of-emacs 'emacs) (featurep 'emacs)) - (t t)) - (cond ((eq op '=) (and (= emacs-minor-version minor) - (= emacs-major-version major))) - ((memq op '(> >= < <=)) - (and (or (funcall op emacs-major-version major) - (= emacs-major-version major)) - (if (= emacs-major-version major) - (funcall op emacs-minor-version minor) - t))) - (t - (error "%S: Invalid op in viper-check-version" op)))) - (cond ((memq op '(= > >=)) nil) - ((memq op '(< <=)) t)))) + (cond ((eq op '=) (and (= emacs-minor-version minor) + (= emacs-major-version major))) + ((memq op '(> >= < <=)) + (and (or (funcall op emacs-major-version major) + (= emacs-major-version major)) + (if (= emacs-major-version major) + (funcall op emacs-minor-version minor) + t))) + (t + (error "%S: Invalid op in viper-check-version" op)))) (defun viper-get-visible-buffer-window (wind) + (declare (obsolete "use `(get-buffer-window wind 'visible)'." "29.1")) (get-buffer-window wind 'visible)) ;; Return line position. @@ -1005,6 +993,7 @@ Otherwise return the normal value." (t (prin1-to-string event-seq))))) (defun viper-key-press-events-to-chars (events) + (declare (obsolete nil "29.1")) (mapconcat #'char-to-string events "")) |