emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master ddbfbeb 1/2: Remove more XEmacs compat code from viper


From: Stefan Kangas
Subject: master ddbfbeb 1/2: Remove more XEmacs compat code from viper
Date: Mon, 17 Aug 2020 07:30:39 -0400 (EDT)

branch: master
commit ddbfbeb0671d13fdd06e6eca4328af02d922c6a5
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>

    Remove more XEmacs compat code from viper
    
    * lisp/emulation/viper-util.el (viper-sit-for-short)
    (viper-last-command-char): Make obsolete.
    (viper-fast-keysequence-p):
    * lisp/emulation/viper-cmd.el (viper-escape-to-emacs)
    (viper-digit-argument, viper-command-argument, viper-undo)
    (viper-exit-minibuffer):
    * lisp/emulation/viper-mous.el (viper-multiclick-p):
    Adjust callers.
---
 lisp/emulation/viper-cmd.el  | 12 ++++++------
 lisp/emulation/viper-mous.el |  2 +-
 lisp/emulation/viper-util.el | 13 ++++++-------
 3 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 77f1b29..b10a533 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -694,7 +694,7 @@
 ARG is used as the prefix value for the executed command.  If
 EVENTS is a list of events, which become the beginning of the command."
   (interactive "P")
-  (if (viper= (viper-last-command-char) ?\\)
+  (if (viper= last-command-event ?\\)
       (message "Switched to EMACS state for the next command..."))
   (viper-escape-to-state arg events 'emacs-state))
 
@@ -1149,7 +1149,7 @@ as a Meta key and any number of multiple escapes are 
allowed."
   "Begin numeric argument for the next command."
   (interactive "P")
   (viper-prefix-arg-value
-   (viper-last-command-char) (if (consp arg) (cdr arg) nil)))
+   last-command-event (if (consp arg) (cdr arg) nil)))
 
 (defun viper-command-argument (arg)
   "Accept a motion command as an argument."
@@ -1157,7 +1157,7 @@ as a Meta key and any number of multiple escapes are 
allowed."
   (let ((viper-intermediate-command 'viper-command-argument))
     (condition-case nil
        (viper-prefix-arg-com
-        (viper-last-command-char)
+        last-command-event
         (cond ((null arg) nil)
               ((consp arg) (car arg))
               ((integerp arg) arg)
@@ -1598,9 +1598,9 @@ invokes the command before that, etc."
                   (pos-visible-in-window-p before-undo-pt))
              (progn
                (push-mark (point-marker) t)
-               (viper-sit-for-short 300)
+               (sit-for 0.3)
                (goto-char undo-end-posn)
-               (viper-sit-for-short 300)
+               (sit-for 0.3)
                (if (pos-visible-in-window-p undo-beg-posn)
                    (goto-char before-undo-pt)
                  (goto-char undo-beg-posn)))
@@ -1908,7 +1908,7 @@ Undo previous insertion and inserts new."
   "Exit minibuffer Viper way."
   (interactive)
   (let (command)
-    (setq command (local-key-binding (char-to-string 
(viper-last-command-char))))
+    (setq command (local-key-binding (char-to-string last-command-event)))
     (run-hooks 'viper-minibuffer-exit-hook)
     (if command
        (command-execute command)
diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el
index 6ecfec5..928a3ef 100644
--- a/lisp/emulation/viper-mous.el
+++ b/lisp/emulation/viper-mous.el
@@ -98,7 +98,7 @@ considered related."
 ;;; Code
 
 (defsubst viper-multiclick-p ()
-  (not (viper-sit-for-short viper-multiclick-timeout t)))
+  (not (sit-for (/ viper-multiclick-timeout 1000.0) t)))
 
 ;; Returns window where click occurs
 (defun viper-mouse-click-window (click)
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index 1561204..61bc266 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -808,9 +808,8 @@ Otherwise return the normal value."
 (define-obsolete-function-alias 'viper-abbreviate-file-name
   'abbreviate-file-name "27.1")
 
-;; Sit for VAL milliseconds.  XEmacs doesn't support the millisecond arg
-;; in sit-for, so this function smooths out the differences.
 (defsubst viper-sit-for-short (val &optional nodisp)
+  (declare (obsolete nil "28.1"))
   (sit-for (/ val 1000.0) nodisp))
 
 ;; EVENT may be a single event of a sequence of events
@@ -868,11 +867,10 @@ Otherwise return the normal value."
 
 ;; Uses different timeouts for ESC-sequences and others
 (defun viper-fast-keysequence-p ()
-  (not (viper-sit-for-short
-       (if (viper-ESC-event-p last-input-event)
-           (viper-ESC-keyseq-timeout)
-         viper-fast-keyseq-timeout)
-       t)))
+  (not (sit-for (/ (if (viper-ESC-event-p last-input-event)
+                      (viper-ESC-keyseq-timeout)
+                    viper-fast-keyseq-timeout) 1000.0)
+               t)))
 
 (define-obsolete-function-alias 'viper-read-event-convert-to-char
   'read-event "27.1")
@@ -920,6 +918,7 @@ Otherwise return the normal value."
       basis)))
 
 (defun viper-last-command-char ()
+  (declare (obsolete nil "28.1"))
   last-command-event)
 
 (defun viper-key-to-emacs-key (key)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]