]> code.delx.au - gnu-emacs/blobdiff - lisp/emulation/vi.el
* faces.el (tty-run-terminal-initialization): function changed (Stefan
[gnu-emacs] / lisp / emulation / vi.el
index de7bcffdf0e3f697e739efe8e4ed4577f619d118..9aae40c0d00ed4ced974df47a8df9ca8456a0b2d 100644 (file)
@@ -28,7 +28,7 @@
 ;;                               (if (not (or (eq major-mode 'Info-mode)
 ;;                                          (eq major-mode 'vi-mode)))
 ;;                                   (vi-mode))))))
-;; 3) In your .emacs file you can define the command "vi-mode" to be "autoload"
+;; 3) In your init file you can define the command "vi-mode" to be "autoload"
 ;;    or you can execute the "load" command to load "vi" directly.
 ;; 4) Read the comments for command "vi-mode" before you start using it.
 
@@ -79,8 +79,7 @@
     (if (null mode-cmd)
        (with-output-to-temp-buffer "*Help*"
          (princ (substitute-command-keys "Possible major modes to switch to: \\{vi-tilde-map}"))
-         (save-excursion
-           (set-buffer standard-output)
+         (with-current-buffer standard-output
            (help-mode)))
       (setq prefix-arg arg)            ; prefix arg will be passed down
       (command-execute mode-cmd nil)   ; may need to save mode-line-format etc
@@ -143,7 +142,7 @@ command extensions.")
   (define-key vi-com-map "\C-s" 'vi-isearch-forward)  ; extension
   (define-key vi-com-map "\C-t" 'vi-transpose-objects) ; extension
   (define-key vi-com-map "\C-u" 'vi-scroll-up-window)
-  (define-key vi-com-map "\C-v" 'scroll-up) ; extension
+  (define-key vi-com-map "\C-v" 'scroll-up-command) ; extension
   (define-key vi-com-map "\C-w" 'vi-kill-region)   ; extension
   (define-key vi-com-map "\C-x" 'Control-X-prefix) ; extension
   (define-key vi-com-map "\C-y" 'vi-expose-line-above)
@@ -499,20 +498,19 @@ set sw=n     M-x set-variable vi-shift-width n "
 ;;  (cond ((string-match "s"))))
   (with-output-to-temp-buffer "*Help*"
     (princ (documentation 'vi-ex-cmd))
-    (save-excursion
-      (set-buffer standard-output)
+    (with-current-buffer standard-output
       (help-mode))))
 
 (defun vi-undefined ()
   (interactive)
   (message "Command key \"%s\" is undefined in Evi."
-          (single-key-description last-command-char))
+          (single-key-description last-command-event))
   (ding))
 
 (defun vi-unimplemented ()
   (interactive)
   (message "Command key \"%s\" is not implemented in Evi."
-          (single-key-description last-command-char))
+          (single-key-description last-command-event))
   (ding))
 
 ;;;;;
@@ -639,7 +637,7 @@ insert state."
    (if (null (vi-raw-numeric-prefix arg))
        (with-no-warnings
         (end-of-buffer))
-     (goto-line (vi-prefix-numeric-value arg))))
+     (with-no-warnings (goto-line (vi-prefix-numeric-value arg)))))
 
 (defun vi-beginning-of-buffer ()
   "Move point to the beginning of current buffer."
@@ -832,7 +830,7 @@ Possible prefix-arg cases are nil, INTEGER, (nil . CHAR) or (INTEGER . CHAR)."
 (defun vi-goto-mark (mark-char &optional line-flag)
   "Go to marked position or line (if line-flag is given).
 Goto mark '@' means jump into and pop the top mark on the mark ring."
-  (cond ((char-equal mark-char last-command-char)      ; `` or ''
+  (cond ((char-equal mark-char last-command-event)     ; `` or ''
         (exchange-point-and-mark) (if line-flag (back-to-indentation)))
        ((char-equal mark-char ?@)      ; jump and pop mark
         (set-mark-command t) (if line-flag (back-to-indentation)))
@@ -949,7 +947,7 @@ With argument, do this that many times."
   "Replace char after point by CHAR.  Repeat COUNT times."
   (interactive "p\nc")
   (delete-char count nil)       ; don't save in kill ring
-  (setq last-command-char char)
+  (setq last-command-event char)
   (self-insert-command count)
   (vi-set-last-change-command 'vi-replace-1-char count char))
 
@@ -984,15 +982,15 @@ With argument, do this that many times."
 the key bindings of the operators being fixed."
   (interactive "P")
   (catch 'vi-exit-op
-    (let ((this-op-char last-command-char))
-      (setq last-command-char (read-char))
-      (setq this-command (lookup-key vi-com-map (char-to-string last-command-char)))
+    (let ((this-op-char last-command-event))
+      (setq last-command-event (read-char))
+      (setq this-command (lookup-key vi-com-map (char-to-string last-command-event)))
       (if (not (eq this-command 'vi-digit-argument))
          (setq prefix-arg arg)
        (vi-digit-argument arg)
-       (setq last-command-char (read-char))
-       (setq this-command (lookup-key vi-com-map (char-to-string last-command-char))))
-      (cond ((char-equal this-op-char last-command-char) ; line op
+       (setq last-command-event (read-char))
+       (setq this-command (lookup-key vi-com-map (char-to-string last-command-event))))
+      (cond ((char-equal this-op-char last-command-event) ; line op
             (vi-execute-op this-op-char 'next-line
                            (cons (1- (vi-prefix-numeric-value prefix-arg))
                                  (vi-prefix-char-value prefix-arg))))
@@ -1150,7 +1148,8 @@ If char argument is given, it directs the output to a *temp* buffer."
       (cond ((null shell-command)
             (setq shell-command (read-string "!" nil))
             (setq vi-last-shell-command shell-command)))
-      (shell-command-on-region begin end shell-command (not (vi-prefix-char-value arg)))
+      (shell-command-on-region begin end shell-command (not (vi-prefix-char-value arg))
+                                                      (not (vi-prefix-char-value arg)))
       t)))
 
 (defun vi-shift-op (motion-command arg amount)
@@ -1490,5 +1489,4 @@ With ARG, inserts that many newlines."
 
 (provide 'vi)
 
-;; arch-tag: ac9bdac3-8acb-4ddd-bdae-c6dd873153b3
 ;;; vi.el ends here