diff options
Diffstat (limited to 'lisp/emulation/viper-cmd.el')
-rw-r--r-- | lisp/emulation/viper-cmd.el | 27 |
1 files changed, 11 insertions, 16 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 @@ 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) @@ -1564,7 +1564,7 @@ invokes the command before that, etc." ;; Hook used in viper-undo (defun viper-after-change-undo-hook (beg end _len) - (if (and (boundp 'undo-in-progress) undo-in-progress) + (if undo-in-progress (setq undo-beg-posn beg undo-end-posn (or end beg)) ;; some other hooks may be changing various text properties in @@ -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))) @@ -1886,15 +1886,11 @@ Undo previous insertion and inserts new." (or unread-command-events executing-kbd-macro (sit-for 840)) - (if (fboundp 'minibuffer-prompt-end) - (delete-region (minibuffer-prompt-end) (point-max)) - (erase-buffer)) + (delete-region (minibuffer-prompt-end) (point-max)) (insert viper-initial))) (defsubst viper-minibuffer-real-start () - (if (fboundp 'minibuffer-prompt-end) - (minibuffer-prompt-end) - (point-min))) + (minibuffer-prompt-end)) (defun viper-minibuffer-post-command-hook() (when (active-minibuffer-window) @@ -1908,7 +1904,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) @@ -2883,7 +2879,7 @@ If point is on a widget or a button, simulate clicking on that widget/button." (and (consp widget) (get (widget-type widget) 'widget-type)))) (widget-button-press (point)) - (if (and (fboundp 'button-at) (fboundp 'push-button) (button-at (point))) + (if (button-at (point)) (push-button) ;; not a widget or a button (save-excursion @@ -4738,8 +4734,7 @@ Please, specify your level now: ")) (viper-color-display-p (if (viper-window-display-p) (viper-color-display-p) 'non-x)) - (viper-frame-parameters (if (fboundp 'frame-parameters) - (frame-parameters (selected-frame)))) + (viper-frame-parameters (frame-parameters (selected-frame))) (viper-minibuffer-emacs-face (if (viper-has-face-support-p) (facep viper-minibuffer-emacs-face) |