]> code.delx.au - gnu-emacs/blobdiff - lisp/emulation/vi.el
entered into RCS
[gnu-emacs] / lisp / emulation / vi.el
index fb76742c295824ec90cd5df7f605cca8b60c9078..00b2debbe4e2bbd83e4c90d1e4b7aee0fe949b54 100644 (file)
@@ -1,5 +1,11 @@
 ;;; vi.el --- major mode for emulating "vi" editor under GNU Emacs.
 
+;; Author: Neal Ziring <nz@rsch.wisc.edu>
+;;     Felix S. T. Wu <wu@crys.wisc.edu>
+;; Keywords: emulations
+
+;;; Commentary: 
+
 ; Originally written by : seismo!wucs!nz@rsch.wisc.edu (Neal Ziring)
 ; Extensively redesigned and rewritten by wu@crys.wisc.edu (Felix S.T. Wu)
 ; Last revision: 01/07/87 Wed (for GNU Emacs 18.33)
@@ -26,6 +32,7 @@
 ; 2). In operator handling, should allow other point moving Emacs commands
 ;     (such as ESC <, ESC >) to be used as arguments.
 ;
+;;; Code:
 
 (defun vi-switch-mode (arg mode-char)
   "Switch the major mode of current buffer as specified by the following char \\{vi-tilde-map}"
@@ -1077,15 +1084,12 @@ If the optional after-p is given, put after/below the cursor."
        (error "Nothing in register %c" reg)
       (if (null reg) (setq reg ?1))    ; the default is the last text killed
       (setq put-text
-           (if (and (>= reg ?1) (<= reg ?9))
-               (let ((ring-length (length kill-ring)))
-                 (setq this-command 'yank) ; So we may yank-pop !!
-                 (nth (% (+ (- reg ?0 1) (- ring-length
-                                            (length kill-ring-yank-pointer)))
-                         ring-length) kill-ring))
-             (if (stringp (get-register reg))
-                 (get-register reg)
-               (error "Register %c is not containing text string" reg))))
+           (cond
+            ((and (>= reg ?1) (<= reg ?9))
+             (setq this-command 'yank) ; So we may yank-pop !!
+             (current-kill (- reg ?0 1) 'do-not-rotate))
+            ((stringp (get-register reg)) (get-register reg))
+            (t (error "Register %c is not containing text string" reg))))
       (if (vi-string-end-with-nl-p put-text) ; put back text as lines
          (if after-p
              (progn (next-line 1) (beginning-of-line))