emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/emulation/vi.el


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/lisp/emulation/vi.el
Date: Tue, 04 Feb 2003 07:56:08 -0500

Index: emacs/lisp/emulation/vi.el
diff -c emacs/lisp/emulation/vi.el:1.20 emacs/lisp/emulation/vi.el:1.21
*** emacs/lisp/emulation/vi.el:1.20     Mon Jul 16 07:39:41 2001
--- emacs/lisp/emulation/vi.el  Tue Feb  4 07:56:02 2003
***************
*** 30,36 ****
  ;                                    (vi-mode))))))
  ; 3) In your .emacs 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.   
  ;
  ; COULD DO
  ; 1). A general 'define-operator' function to replace current hack
--- 30,36 ----
  ;                                    (vi-mode))))))
  ; 3) In your .emacs 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.
  ;
  ; COULD DO
  ; 1). A general 'define-operator' function to replace current hack
***************
*** 153,159 ****
    (define-key vi-com-map "\C-\\" 'vi-unimplemented)
    (define-key vi-com-map "\C-]" 'find-tag)
    (define-key vi-com-map "\C-^" 'vi-locate-def)  ; extension
!   (define-key vi-com-map "\C-_" 'vi-undefined) 
  
    (define-key vi-com-map " " 'forward-char)
    (define-key vi-com-map "!"  'vi-operator)
--- 153,159 ----
    (define-key vi-com-map "\C-\\" 'vi-unimplemented)
    (define-key vi-com-map "\C-]" 'find-tag)
    (define-key vi-com-map "\C-^" 'vi-locate-def)  ; extension
!   (define-key vi-com-map "\C-_" 'vi-undefined)
  
    (define-key vi-com-map " " 'forward-char)
    (define-key vi-com-map "!"  'vi-operator)
***************
*** 201,207 ****
    (define-key vi-com-map "H"  'vi-home-window-line)
    (define-key vi-com-map "I"  'vi-insert-before-first-nonwhite)
    (define-key vi-com-map "J"  'vi-join-lines)
!   (define-key vi-com-map "K"  'vi-undefined) 
    (define-key vi-com-map "L"  'vi-last-window-line)
    (define-key vi-com-map "M"  'vi-middle-window-line)
    (define-key vi-com-map "N"  'vi-reverse-last-search)
--- 201,207 ----
    (define-key vi-com-map "H"  'vi-home-window-line)
    (define-key vi-com-map "I"  'vi-insert-before-first-nonwhite)
    (define-key vi-com-map "J"  'vi-join-lines)
!   (define-key vi-com-map "K"  'vi-undefined)
    (define-key vi-com-map "L"  'vi-last-window-line)
    (define-key vi-com-map "M"  'vi-middle-window-line)
    (define-key vi-com-map "N"  'vi-reverse-last-search)
***************
*** 212,218 ****
    (define-key vi-com-map "S"  'vi-substitute-lines)
    (define-key vi-com-map "T"  'vi-backward-upto-char)
    (define-key vi-com-map "U"  'vi-unimplemented)
!   (define-key vi-com-map "V"  'vi-undefined) 
    (define-key vi-com-map "W"  'vi-forward-blank-delimited-word)
    (define-key vi-com-map "X"  'call-last-kbd-macro) ; modification/extension
    (define-key vi-com-map "Y"  'vi-yank-line)
--- 212,218 ----
    (define-key vi-com-map "S"  'vi-substitute-lines)
    (define-key vi-com-map "T"  'vi-backward-upto-char)
    (define-key vi-com-map "U"  'vi-unimplemented)
!   (define-key vi-com-map "V"  'vi-undefined)
    (define-key vi-com-map "W"  'vi-forward-blank-delimited-word)
    (define-key vi-com-map "X"  'call-last-kbd-macro) ; modification/extension
    (define-key vi-com-map "Y"  'vi-yank-line)
***************
*** 247,253 ****
    (define-key vi-com-map "s"  'vi-substitute-chars)
    (define-key vi-com-map "t"  'vi-forward-upto-char)
    (define-key vi-com-map "u"  'undo)
!   (define-key vi-com-map "v"  'vi-verify-spelling) 
    (define-key vi-com-map "w"  'vi-forward-word)
    (define-key vi-com-map "x"  'vi-kill-char)
    (define-key vi-com-map "y"  'vi-operator)
--- 247,253 ----
    (define-key vi-com-map "s"  'vi-substitute-chars)
    (define-key vi-com-map "t"  'vi-forward-upto-char)
    (define-key vi-com-map "u"  'undo)
!   (define-key vi-com-map "v"  'vi-verify-spelling)
    (define-key vi-com-map "w"  'vi-forward-word)
    (define-key vi-com-map "x"  'vi-kill-char)
    (define-key vi-com-map "y"  'vi-operator)
***************
*** 355,361 ****
    "Non-nil if it is in insert state.")
  
  ; in "loaddefs.el"
! ;(defvar search-last-string "" 
  ;  "Last string search for by a search command.")
  
  (defvar vi-search-last-command nil    ; (re-)search-forward(backward)
--- 355,361 ----
    "Non-nil if it is in insert state.")
  
  ; in "loaddefs.el"
! ;(defvar search-last-string ""
  ;  "Last string search for by a search command.")
  
  (defvar vi-search-last-command nil    ; (re-)search-forward(backward)
***************
*** 366,377 ****
  
  (defvar vi-mode-old-mode-name nil
    "Save the mode-name before entering vi-mode.")
!   
  (defvar vi-mode-old-major-mode nil
    "Save the major-mode before entering vi-mode.")
  
  (defvar vi-mode-old-case-fold nil)
!   
  ;(defconst vi-add-to-mode-line-1
  ;  '(overwrite-mode nil " Insert"))
  
--- 366,377 ----
  
  (defvar vi-mode-old-mode-name nil
    "Save the mode-name before entering vi-mode.")
! 
  (defvar vi-mode-old-major-mode nil
    "Save the major-mode before entering vi-mode.")
  
  (defvar vi-mode-old-case-fold nil)
! 
  ;(defconst vi-add-to-mode-line-1
  ;  '(overwrite-mode nil " Insert"))
  
***************
*** 404,410 ****
    (make-local-variable 'vi-mode-old-major-mode)
    (make-local-variable 'vi-mode-old-case-fold)
    (run-hooks 'vi-mode-hook))
!       
  ;;;###autoload
  (defun vi-mode ()
    "Major mode that acts like the `vi' editor.
--- 404,410 ----
    (make-local-variable 'vi-mode-old-major-mode)
    (make-local-variable 'vi-mode-old-case-fold)
    (run-hooks 'vi-mode-hook))
! 
  ;;;###autoload
  (defun vi-mode ()
    "Major mode that acts like the `vi' editor.
***************
*** 448,454 ****
      `vi-name-last-change-or-macro', `vi-verify-spelling', `vi-locate-def',
      `vi-mark-region', and 'vi-quote-words'.  Some of them are quite handy.
    - Use \\[vi-switch-mode] to switch among different modes quickly.
!   
  Syntax table and abbrevs while in vi mode remain as they were in Emacs."
     (interactive)
     (if (null vi-mode-old-major-mode)  ; very first call for current buffer
--- 448,454 ----
      `vi-name-last-change-or-macro', `vi-verify-spelling', `vi-locate-def',
      `vi-mark-region', and 'vi-quote-words'.  Some of them are quite handy.
    - Use \\[vi-switch-mode] to switch among different modes quickly.
! 
  Syntax table and abbrevs while in vi mode remain as they were in Emacs."
     (interactive)
     (if (null vi-mode-old-major-mode)  ; very first call for current buffer
***************
*** 539,545 ****
          (<= vi-ins-repetition 0))
        (vi-goto-command-state t)
      (if (> vi-ins-repetition 1)
!       (progn 
          (let ((str (buffer-substring vi-ins-point (point))))
            (while (> vi-ins-repetition 1)
              (insert str)
--- 539,545 ----
          (<= vi-ins-repetition 0))
        (vi-goto-command-state t)
      (if (> vi-ins-repetition 1)
!       (progn
          (let ((str (buffer-substring vi-ins-point (point))))
            (while (> vi-ins-repetition 1)
              (insert str)
***************
*** 585,591 ****
    (interactive "*r")
    (kill-region start end)
    (vi-set-last-change-command 'kill-region))
!   
  (defun vi-append-at-end-of-line (arg)
     "go to end of line and then go into vi insert state."
     (interactive "*p")
--- 585,591 ----
    (interactive "*r")
    (kill-region start end)
    (vi-set-last-change-command 'kill-region))
! 
  (defun vi-append-at-end-of-line (arg)
     "go to end of line and then go into vi insert state."
     (interactive "*p")
***************
*** 651,657 ****
  ;;;;;
  
  (defun vi-isearch-forward (arg)
!   "Incremental search forward.  Use regexp version if ARG is non-nil." 
    (interactive "P")
    (let ((scmd (if arg 'isearch-forward-regexp 'isearch-forward))
        (opoint (point)))
--- 651,657 ----
  ;;;;;
  
  (defun vi-isearch-forward (arg)
!   "Incremental search forward.  Use regexp version if ARG is non-nil."
    (interactive "P")
    (let ((scmd (if arg 'isearch-forward-regexp 'isearch-forward))
        (opoint (point)))
***************
*** 724,730 ****
                   ((eq search-command 'search-forward) 'search-backward)
                   ((eq search-command 'search-backward) 'search-forward))
             search-string nil nil arg)))
!        
  (defun vi-join-lines (arg)
     "join ARG lines from current line (default 2), cleaning up white space."
     (interactive "P")
--- 724,730 ----
                   ((eq search-command 'search-forward) 'search-backward)
                   ((eq search-command 'search-backward) 'search-forward))
             search-string nil nil arg)))
! 
  (defun vi-join-lines (arg)
     "join ARG lines from current line (default 2), cleaning up white space."
     (interactive "P")
***************
*** 842,848 ****
             (set-mark-command nil)
             (goto-char mark)
             (if line-flag (back-to-indentation)))))))
!                    
  (defun vi-goto-line-mark (char)
    "Go to the line (at first non-white) marked by next char."
    (interactive "c")
--- 842,848 ----
             (set-mark-command nil)
             (goto-char mark)
             (if line-flag (back-to-indentation)))))))
! 
  (defun vi-goto-line-mark (char)
    "Go to the line (at first non-white) marked by next char."
    (interactive "c")
***************
*** 1062,1068 ****
              ((eq moving-unit 'line)
               (goto-char begin) (beginning-of-line) (setq begin (point))
               (goto-char end) (next-line 1) (beginning-of-line) (setq end 
(point))))
!       (if (> end (point-max)) (setq end (point-max))) ; force in buffer 
region 
        (cons begin end)))))
  
  (defun vi-delete-op (motion-command arg)
--- 1062,1068 ----
              ((eq moving-unit 'line)
               (goto-char begin) (beginning-of-line) (setq begin (point))
               (goto-char end) (next-line 1) (beginning-of-line) (setq end 
(point))))
!       (if (> end (point-max)) (setq end (point-max))) ; force in buffer region
        (cons begin end)))))
  
  (defun vi-delete-op (motion-command arg)
***************
*** 1106,1112 ****
    (= (aref string (1- (length string))) ?\n))
  
  (defun vi-put-before (arg &optional after-p)
!   "Put yanked (in vi sense) text back before/above cursor.  
  If a numeric prefix value (currently it should be >1) is given, put back
  text as lines.  If the optional after-p is given, put after/below the cursor."
    (interactive "P")
--- 1106,1112 ----
    (= (aref string (1- (length string))) ?\n))
  
  (defun vi-put-before (arg &optional after-p)
!   "Put yanked (in vi sense) text back before/above cursor.
  If a numeric prefix value (currently it should be >1) is given, put back
  text as lines.  If the optional after-p is given, put after/below the cursor."
    (interactive "P")
***************
*** 1302,1308 ****
    (interactive "*P")
    (let ((rcmd (if arg 'replace-regexp 'replace-string)))
      (call-interactively rcmd nil)))
!        
  (defun vi-adjust-window (arg position)
    "Move current line to the top/center/bottom of the window."
    (interactive "p\nc")
--- 1302,1308 ----
    (interactive "*P")
    (let ((rcmd (if arg 'replace-regexp 'replace-string)))
      (call-interactively rcmd nil)))
! 
  (defun vi-adjust-window (arg position)
    "Move current line to the top/center/bottom of the window."
    (interactive "p\nc")
***************
*** 1329,1335 ****
        (ding))))
  
  (defun vi-name-last-change-or-macro (arg char)
!   "Give name to the last change command or just defined kbd macro.  
  If prefix ARG is given, name last macro, otherwise name last change command.
  The following CHAR will be the name for the command or macro."
    (interactive "P\nc")
--- 1329,1335 ----
        (ding))))
  
  (defun vi-name-last-change-or-macro (arg char)
!   "Give name to the last change command or just defined kbd macro.
  If prefix ARG is given, name last macro, otherwise name last change command.
  The following CHAR will be the name for the command or macro."
    (interactive "P\nc")
***************
*** 1343,1349 ****
          (vi-set-last-change-command 'vi-more-redo-insertion str
                                   overwrite-p prefix-code)))
      (fset (intern (char-to-string char)) vi-last-change-command)))
!   
  (defun vi-call-named-change-or-macro (count char)
    "Execute COUNT times the keyboard macro definition named by the following 
CHAR."
    (interactive "p\nc")
--- 1343,1349 ----
          (vi-set-last-change-command 'vi-more-redo-insertion str
                                   overwrite-p prefix-code)))
      (fset (intern (char-to-string char)) vi-last-change-command)))
! 
  (defun vi-call-named-change-or-macro (count char)
    "Execute COUNT times the keyboard macro definition named by the following 
CHAR."
    (interactive "p\nc")




reply via email to

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