aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emulation
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emulation')
-rw-r--r--lisp/emulation/viper-cmd.el27
-rw-r--r--lisp/emulation/viper-mous.el2
-rw-r--r--lisp/emulation/viper-util.el20
3 files changed, 20 insertions, 29 deletions
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 77f1b291043..dd7648c2b77 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -694,7 +694,7 @@
694ARG is used as the prefix value for the executed command. If 694ARG is used as the prefix value for the executed command. If
695EVENTS is a list of events, which become the beginning of the command." 695EVENTS is a list of events, which become the beginning of the command."
696 (interactive "P") 696 (interactive "P")
697 (if (viper= (viper-last-command-char) ?\\) 697 (if (viper= last-command-event ?\\)
698 (message "Switched to EMACS state for the next command...")) 698 (message "Switched to EMACS state for the next command..."))
699 (viper-escape-to-state arg events 'emacs-state)) 699 (viper-escape-to-state arg events 'emacs-state))
700 700
@@ -1149,7 +1149,7 @@ as a Meta key and any number of multiple escapes are allowed."
1149 "Begin numeric argument for the next command." 1149 "Begin numeric argument for the next command."
1150 (interactive "P") 1150 (interactive "P")
1151 (viper-prefix-arg-value 1151 (viper-prefix-arg-value
1152 (viper-last-command-char) (if (consp arg) (cdr arg) nil))) 1152 last-command-event (if (consp arg) (cdr arg) nil)))
1153 1153
1154(defun viper-command-argument (arg) 1154(defun viper-command-argument (arg)
1155 "Accept a motion command as an argument." 1155 "Accept a motion command as an argument."
@@ -1157,7 +1157,7 @@ as a Meta key and any number of multiple escapes are allowed."
1157 (let ((viper-intermediate-command 'viper-command-argument)) 1157 (let ((viper-intermediate-command 'viper-command-argument))
1158 (condition-case nil 1158 (condition-case nil
1159 (viper-prefix-arg-com 1159 (viper-prefix-arg-com
1160 (viper-last-command-char) 1160 last-command-event
1161 (cond ((null arg) nil) 1161 (cond ((null arg) nil)
1162 ((consp arg) (car arg)) 1162 ((consp arg) (car arg))
1163 ((integerp arg) arg) 1163 ((integerp arg) arg)
@@ -1564,7 +1564,7 @@ invokes the command before that, etc."
1564 1564
1565;; Hook used in viper-undo 1565;; Hook used in viper-undo
1566(defun viper-after-change-undo-hook (beg end _len) 1566(defun viper-after-change-undo-hook (beg end _len)
1567 (if (and (boundp 'undo-in-progress) undo-in-progress) 1567 (if undo-in-progress
1568 (setq undo-beg-posn beg 1568 (setq undo-beg-posn beg
1569 undo-end-posn (or end beg)) 1569 undo-end-posn (or end beg))
1570 ;; some other hooks may be changing various text properties in 1570 ;; some other hooks may be changing various text properties in
@@ -1598,9 +1598,9 @@ invokes the command before that, etc."
1598 (pos-visible-in-window-p before-undo-pt)) 1598 (pos-visible-in-window-p before-undo-pt))
1599 (progn 1599 (progn
1600 (push-mark (point-marker) t) 1600 (push-mark (point-marker) t)
1601 (viper-sit-for-short 300) 1601 (sit-for 0.3)
1602 (goto-char undo-end-posn) 1602 (goto-char undo-end-posn)
1603 (viper-sit-for-short 300) 1603 (sit-for 0.3)
1604 (if (pos-visible-in-window-p undo-beg-posn) 1604 (if (pos-visible-in-window-p undo-beg-posn)
1605 (goto-char before-undo-pt) 1605 (goto-char before-undo-pt)
1606 (goto-char undo-beg-posn))) 1606 (goto-char undo-beg-posn)))
@@ -1886,15 +1886,11 @@ Undo previous insertion and inserts new."
1886 (or unread-command-events 1886 (or unread-command-events
1887 executing-kbd-macro 1887 executing-kbd-macro
1888 (sit-for 840)) 1888 (sit-for 840))
1889 (if (fboundp 'minibuffer-prompt-end) 1889 (delete-region (minibuffer-prompt-end) (point-max))
1890 (delete-region (minibuffer-prompt-end) (point-max))
1891 (erase-buffer))
1892 (insert viper-initial))) 1890 (insert viper-initial)))
1893 1891
1894(defsubst viper-minibuffer-real-start () 1892(defsubst viper-minibuffer-real-start ()
1895 (if (fboundp 'minibuffer-prompt-end) 1893 (minibuffer-prompt-end))
1896 (minibuffer-prompt-end)
1897 (point-min)))
1898 1894
1899(defun viper-minibuffer-post-command-hook() 1895(defun viper-minibuffer-post-command-hook()
1900 (when (active-minibuffer-window) 1896 (when (active-minibuffer-window)
@@ -1908,7 +1904,7 @@ Undo previous insertion and inserts new."
1908 "Exit minibuffer Viper way." 1904 "Exit minibuffer Viper way."
1909 (interactive) 1905 (interactive)
1910 (let (command) 1906 (let (command)
1911 (setq command (local-key-binding (char-to-string (viper-last-command-char)))) 1907 (setq command (local-key-binding (char-to-string last-command-event)))
1912 (run-hooks 'viper-minibuffer-exit-hook) 1908 (run-hooks 'viper-minibuffer-exit-hook)
1913 (if command 1909 (if command
1914 (command-execute command) 1910 (command-execute command)
@@ -2883,7 +2879,7 @@ If point is on a widget or a button, simulate clicking on that widget/button."
2883 (and (consp widget) 2879 (and (consp widget)
2884 (get (widget-type widget) 'widget-type)))) 2880 (get (widget-type widget) 'widget-type))))
2885 (widget-button-press (point)) 2881 (widget-button-press (point))
2886 (if (and (fboundp 'button-at) (fboundp 'push-button) (button-at (point))) 2882 (if (button-at (point))
2887 (push-button) 2883 (push-button)
2888 ;; not a widget or a button 2884 ;; not a widget or a button
2889 (save-excursion 2885 (save-excursion
@@ -4738,8 +4734,7 @@ Please, specify your level now: "))
4738 (viper-color-display-p (if (viper-window-display-p) 4734 (viper-color-display-p (if (viper-window-display-p)
4739 (viper-color-display-p) 4735 (viper-color-display-p)
4740 'non-x)) 4736 'non-x))
4741 (viper-frame-parameters (if (fboundp 'frame-parameters) 4737 (viper-frame-parameters (frame-parameters (selected-frame)))
4742 (frame-parameters (selected-frame))))
4743 (viper-minibuffer-emacs-face (if (viper-has-face-support-p) 4738 (viper-minibuffer-emacs-face (if (viper-has-face-support-p)
4744 (facep 4739 (facep
4745 viper-minibuffer-emacs-face) 4740 viper-minibuffer-emacs-face)
diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el
index 6ecfec548cb..928a3ef00ee 100644
--- a/lisp/emulation/viper-mous.el
+++ b/lisp/emulation/viper-mous.el
@@ -98,7 +98,7 @@ considered related."
98;;; Code 98;;; Code
99 99
100(defsubst viper-multiclick-p () 100(defsubst viper-multiclick-p ()
101 (not (viper-sit-for-short viper-multiclick-timeout t))) 101 (not (sit-for (/ viper-multiclick-timeout 1000.0) t)))
102 102
103;; Returns window where click occurs 103;; Returns window where click occurs
104(defun viper-mouse-click-window (click) 104(defun viper-mouse-click-window (click)
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index 1561204151d..83e45e1cd0c 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -786,14 +786,11 @@ Otherwise return the normal value."
786(defun viper-check-minibuffer-overlay () 786(defun viper-check-minibuffer-overlay ()
787 (if (overlayp viper-minibuffer-overlay) 787 (if (overlayp viper-minibuffer-overlay)
788 (move-overlay 788 (move-overlay
789 viper-minibuffer-overlay 789 viper-minibuffer-overlay (minibuffer-prompt-end) (1+ (buffer-size)))
790 (if (fboundp 'minibuffer-prompt-end) (minibuffer-prompt-end) 1)
791 (1+ (buffer-size)))
792 (setq viper-minibuffer-overlay 790 (setq viper-minibuffer-overlay
793 ;; make overlay open-ended 791 ;; make overlay open-ended
794 (make-overlay 792 (make-overlay
795 (if (fboundp 'minibuffer-prompt-end) (minibuffer-prompt-end) 1) 793 (minibuffer-prompt-end) (1+ (buffer-size))
796 (1+ (buffer-size))
797 (current-buffer) nil 'rear-advance)))) 794 (current-buffer) nil 'rear-advance))))
798 795
799 796
@@ -808,9 +805,8 @@ Otherwise return the normal value."
808(define-obsolete-function-alias 'viper-abbreviate-file-name 805(define-obsolete-function-alias 'viper-abbreviate-file-name
809 'abbreviate-file-name "27.1") 806 'abbreviate-file-name "27.1")
810 807
811;; Sit for VAL milliseconds. XEmacs doesn't support the millisecond arg
812;; in sit-for, so this function smooths out the differences.
813(defsubst viper-sit-for-short (val &optional nodisp) 808(defsubst viper-sit-for-short (val &optional nodisp)
809 (declare (obsolete nil "28.1"))
814 (sit-for (/ val 1000.0) nodisp)) 810 (sit-for (/ val 1000.0) nodisp))
815 811
816;; EVENT may be a single event of a sequence of events 812;; EVENT may be a single event of a sequence of events
@@ -868,11 +864,10 @@ Otherwise return the normal value."
868 864
869;; Uses different timeouts for ESC-sequences and others 865;; Uses different timeouts for ESC-sequences and others
870(defun viper-fast-keysequence-p () 866(defun viper-fast-keysequence-p ()
871 (not (viper-sit-for-short 867 (not (sit-for (/ (if (viper-ESC-event-p last-input-event)
872 (if (viper-ESC-event-p last-input-event) 868 (viper-ESC-keyseq-timeout)
873 (viper-ESC-keyseq-timeout) 869 viper-fast-keyseq-timeout) 1000.0)
874 viper-fast-keyseq-timeout) 870 t)))
875 t)))
876 871
877(define-obsolete-function-alias 'viper-read-event-convert-to-char 872(define-obsolete-function-alias 'viper-read-event-convert-to-char
878 'read-event "27.1") 873 'read-event "27.1")
@@ -920,6 +915,7 @@ Otherwise return the normal value."
920 basis))) 915 basis)))
921 916
922(defun viper-last-command-char () 917(defun viper-last-command-char ()
918 (declare (obsolete nil "28.1"))
923 last-command-event) 919 last-command-event)
924 920
925(defun viper-key-to-emacs-key (key) 921(defun viper-key-to-emacs-key (key)