;ELC ;;; compiled by jwz@thalidomide on Fri Dec 31 01:53:14 1993 ;;; from file /th/jwz/emacs19/lisp/emulators/vi.el ;;; emacs version 19.9 Lucid (beta9). ;;; bytecomp version 2.22; 22-dec-93. ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "This file was compiled for Emacs 19.")) (fset 'vi-switch-mode #[(arg mode-char) " !\"Ő!! \n \" !)" [lookup-key vi-tilde-map char-to-string mode-char mode-cmd "*Help*" princ substitute-command-keys "Possible major modes to switch to: \\{vi-tilde-map}" arg prefix-arg command-execute nil set-buffer-modified-p buffer-modified-p] 5 "\ Switch the major mode of current buffer as specified by the following char \\{vi-tilde-map}" "P\nc"]) (byte-code " \" #" [where-is-internal vi-switch-mode current-local-map define-key ctl-x-map "~"] 4) (defvar vi-tilde-map nil "\ Keymap used for \\[vi-switch-mode] prefix key. Link to various major modes.") (byte-code " ##################" [vi-tilde-map make-keymap define-key "a" abbrev-mode "c" c-mode "d" vi-debugging "e" emacs-lisp-mode "f" auto-fill-mode "g" prolog-mode "h" hanoi "i" info-mode "l" lisp-mode "n" nroff-mode "o" overwrite-mode "O" outline-mode "P" picture-mode "r" vi-readonly-mode "t" text-mode "v" vi-mode "x" tex-mode "~" vi-back-to-old-mode] 4) (fset 'vi-debugging #[(arg) "\n?\n!!" [arg t debug-on-error message "Debug-on-error ..." "NO more debug-on-error"] 2 "\ Toggle debug-on-error flag. If prefix arg is given, set t." "P"]) (fset 'vi-back-to-old-mode #[nil "  ! !" [vi-mode-old-major-mode vi-mode-old-mode-name mode-name use-local-map vi-mode-old-local-map major-mode vi-mode-old-case-fold case-fold-search set-buffer-modified-p buffer-modified-p] 2 "\ Go back to the previous mode without setting up for insertion." nil]) (fset 'vi-readonly-mode #[nil "?" [buffer-read-only] 2 "\ Toggle current buffer's readonly flag." nil]) (defvar vi-com-map nil "\ Keymap used in Evi's command state Command state includes most of the vi editing commands, with some Emacs command extensions.") (byte-code "#   # # # # # # # # # # # # # # # # # # # # # # # # # # # # # @A# B# CD# EF# GH# IJ# KL# MN# O# PQ# RS# TU# VW# X# YZ# [\\# ]^# _`# ab# cd# ed# fd# gd# hd# id# jd# kd# ld# mn# op# qF# rF# sF# tu# vw# xy# z{# |}# ~# # # # # # # # # # # # # # # # # # # # # # # # # F# # # # # # # F# F# # # # # # # # D# # # # # # # # # # # # # F# # # # # # ##ځ#####u##`#D#L#N#Q#S#U##\\#Z##b##p##{###############################" [put vi-undefined suppress-keymap t vi-com-map make-keymap define-key "" vi-mark-region "" vi-ask-for-info "" vi-backward-windowfull "" vi-do-old-mode-C-c-command "" vi-scroll-down-window "" vi-expose-line-below "" vi-forward-windowfull "" keyboard-quit " " indent-relative-maybe "\n" vi-next-line " " vi-kill-line " " recenter " " vi-next-line-first-nonwhite "" "" vi-split-open-line "" previous-line "" vi-query-replace "" vi-isearch-backward "" vi-isearch-forward "" vi-transpose-objects "" vi-scroll-up-window "" scroll-up "" vi-kill-region "" Control-X-prefix "" vi-expose-line-above "" suspend-emacs "" ESC-prefix "" vi-unimplemented "" find-tag "" vi-locate-def "" " " forward-char "!" vi-operator "\"" vi-char-argument "#" universal-argument "$" end-of-line "%" vi-find-matching-paren "&" "'" vi-goto-line-mark "(" backward-sexp ")" forward-sexp "*" vi-name-last-change-or-macro "+" "," vi-reverse-last-find-char "-" vi-previous-line-first-nonwhite "." vi-redo-last-change-command "/" vi-search-forward "0" beginning-of-line "1" vi-digit-argument "2" "3" "4" "5" "6" "7" "8" "9" ":" vi-ex-cmd ";" vi-repeat-last-find-char "<" "=" ">" "?" vi-search-backward "@" vi-call-named-change-or-macro "A" vi-append-at-end-of-line "B" vi-backward-blank-delimited-word "C" vi-change-rest-of-line "D" "E" vi-end-of-blank-delimited-word "F" vi-backward-find-char "G" vi-goto-line "H" vi-home-window-line "I" vi-insert-before-first-nonwhite "J" vi-join-lines "K" "L" vi-last-window-line "M" vi-middle-window-line "N" vi-reverse-last-search "O" vi-open-above "P" vi-put-before "Q" vi-quote-words "R" vi-replace-chars "S" vi-substitute-lines "T" vi-backward-upto-char "U" "V" "W" vi-forward-blank-delimited-word "X" call-last-kbd-macro "Y" vi-yank-line "Z" make-sparse-keymap "ZZ" vi-save-all-and-exit "[" "\\" "]" "^" back-to-indentation "_" "`" vi-goto-char-mark "a" vi-insert-after "b" backward-word "c" "d" "e" vi-end-of-word "f" vi-forward-find-char "g" vi-beginning-of-buffer "h" backward-char "i" vi-insert-before "j" "k" "l" "m" vi-set-mark "n" vi-repeat-last-search "o" vi-open-below "p" vi-put-after "q" vi-replace "r" vi-replace-1-char "s" vi-substitute-chars "t" vi-forward-upto-char "u" undo "v" vi-verify-spelling "w" vi-forward-word "x" vi-kill-char "y" "z" vi-adjust-window "{" backward-paragraph "|" vi-goto-column "}" forward-paragraph "~" vi-change-case "" delete-backward-char point-moving-unit char line next-line forward-line search match sexp rev-find vi-re-search-forward find vi-re-search-backward WORD rev-search word vi-forward-char paragraph mark-page region mark-paragraph mark-word mark-sexp mark-defun mark-whole-buffer mark-end-of-sentence mark-c-function] 4) (defvar vi-mark-alist nil "\ Alist of (NAME . MARK), marks are local to each buffer.") (defvar vi-scroll-amount (byte-code " " [window-height 2] 2) "\ Default amount of lines for scrolling (used by " ^D "/" ^U ").") (defvar vi-shift-width 4 "\ Shift amount for " < "/" > " operators.") (defvar vi-ins-point nil "\ Last insertion point. Should use 'mark' instead.") (defvar vi-ins-length nil "\ Length of last insertion.") (defvar vi-ins-repetition nil "\ The repetition required for last insertion.") (defvar vi-ins-overwrt-p nil "\ T if last insertion was a replace actually.") (defvar vi-ins-prefix-code nil "\ Code to be eval'ed before (redo-)insertion begins.") (defvar vi-last-find-char nil "\ Save last direction, char and upto-flag used for char finding.") (defvar vi-last-change-command nil "\ Save commmands for redoing last changes. Each command is in (FUNC . ARGS) form that is ready to be 'apply'ed.") (defvar vi-last-shell-command nil "\ Save last shell command given for \"!\" operator.") (defvar vi-insert-state nil "\ T if it is in insert state.") (defvar vi-search-last-command nil "\ Save last search command for possible redo.") (defvar vi-mode-old-local-map nil "\ Save the local-map used before entering vi-mode.") (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.") (byte-code "!‡" [boundp vi-mode-old-case-fold nil] 2) (fset 'vi-mode-setup #[nil "! å!!!!!!!!!!!!!!!!" [make-local-variable vi-scroll-amount window-height 2 vi-shift-width 4 vi-ins-point vi-ins-length vi-ins-repetition vi-ins-overwrt-p vi-ins-prefix-code vi-last-change-command vi-last-shell-command vi-last-find-char vi-mark-alist vi-insert-state vi-mode-old-local-map vi-mode-old-mode-name vi-mode-old-major-mode vi-mode-old-case-fold run-hooks vi-mode-hook] 2 "\ Setup a buffer for vi-mode by creating necessary buffer-local variables."]) (fset 'vi-mode #[nil " \n= \"  \n\n   ! ! " [vi-mode-old-major-mode vi-mode-setup major-mode vi-mode message "Already in vi-mode." ding current-local-map vi-mode-old-local-map mode-name vi-mode-old-mode-name case-fold-search vi-mode-old-case-fold nil use-local-map vi-com-map "VI" set-buffer-modified-p buffer-modified-p vi-insert-state vi-end-of-insert-state] 3 "\ Major mode that acts like the `vi' editor. The purpose of this mode is to provide you the combined power of vi (namely, the \"cross product\" effect of commands and repeat last changes) and Emacs. This command redefines nearly all keys to look like vi commands. It records the previous major mode, and any vi command for input (`i', `a', `s', etc.) switches back to that mode. Thus, ordinary Emacs (in whatever major mode you had been using) is \"input\" mode as far as vi is concerned. To get back into vi from \"input\" mode, you must issue this command again. Therefore, it is recommended that you assign it to a key. Major differences between this mode and real vi : * Limitations and unsupported features - Search patterns with line offset (e.g. /pat/+3 or /pat/z.) are not supported. - Ex commands are not implemented; try ':' to get some hints. - No line undo (i.e. the 'U' command), but multi-undo is a standard feature. * Modifications - The stopping positions for some point motion commands (word boundary, pattern search) are slightly different from standard 'vi'. Also, no automatic wrap around at end of buffer for pattern searching. - Since changes are done in two steps (deletion then insertion), you need to undo twice to completely undo a change command. But this is not needed for undoing a repeated change command. - No need to set/unset 'magic', to search for a string with regular expr in it just put a prefix arg for the search commands. Replace cmds too. - ^R is bound to incremental backward search, so use ^L to redraw screen. * Extensions - Some standard (or modified) Emacs commands were integrated, such as incremental search, query replace, transpose objects, and keyboard macros. - In command state, ^X links to the 'ctl-x-map', and ESC can be linked to esc-map or set undefined. These can give you the full power of Emacs. - See vi-com-map for those keys that are extensions to standard vi, e.g. `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." nil]) (fset 'vi-ding #[nil " " [ding] 1 "\ Ding !" nil]) (fset 'vi-save-all-and-exit #[nil "! " [save-some-buffers t kill-emacs] 2 "\ Save all modified buffers without asking, then exits emacs." nil]) (byte-code "!!‡" [boundp vi-replaced-string nil vi-replacing-string] 2) (fset 'vi-ex-cmd #[nil "!!" ["*Help*" princ documentation vi-ex-cmd] 4 "\ Ex commands are not implemented in Evi mode. For some commonly used ex commands, you can use the following alternatives for similar effect : w C-x C-s (save-buffer) wq C-x C-c (save-buffers-kill-emacs) w fname C-x C-w (write-file) e fname C-x C-f (find-file) r fname C-x i (insert-file) s/old/new use q (vi-replace) to do unconditional replace use C-q (vi-query-replace) to do query replace set sw=n M-x set-variable vi-shift-width n " nil]) (byte-code "MM" [vi-undefined #[nil " !\" " [message "Command key \"%s\" is undefined in Evi." single-key-description last-command-char ding] 4 nil nil] vi-unimplemented #[nil " !\" " [message "Command key \"%s\" is not implemented in Evi." single-key-description last-command-char ding] 4 nil nil]] 2) (fset 'vi-goto-insert-state #[(repetition &optional prefix-code do-it-now-p) "\n@\nA\"` \n \n !  !щ" [do-it-now-p apply prefix-code vi-ins-point repetition vi-ins-repetition vi-ins-prefix-code vi-mode-old-mode-name mode-name vi-mode-old-case-fold case-fold-search use-local-map vi-mode-old-local-map vi-mode-old-major-mode major-mode set-buffer-modified-p buffer-modified-p t vi-insert-state] 3 "\ Go into insert state, the text entered will be repeated if REPETITION > 1. If PREFIX-CODE is given, do it before insertion begins if DO-IT-NOW-P is T. In any case, the prefix-code will be done before each 'redo-insert'. This function expects 'overwrite-mode' being set properly beforehand."]) (fset 'vi-end-of-insert-state #[nil "`W`U \nX!\nV`{\nVc\nSr)`\n %!" [vi-ins-point vi-ins-prefix-code vi-ins-repetition 0 vi-goto-command-state t 1 str vi-set-last-change-command vi-first-redo-insertion overwrite-mode] 7 "\ Terminate insertion and set up last change command."]) (fset 'vi-first-redo-insertion #[(begin end &optional overwrite-p prefix-code) " { @ A\" ``\nG\\|\nc\n $)" [begin end str prefix-code apply overwrite-p vi-set-last-change-command vi-more-redo-insertion] 5 "\ Redo last insertion the first time. Extract the string and save it for future redoes. Do prefix-code if it's given, use overwrite mode if asked."]) (fset 'vi-more-redo-insertion #[(str &optional overwrite-p prefix-code) "@A\"\n`` G\\| c" [prefix-code apply overwrite-p str] 3 "\ Redo more insertion : copy string from STR to point, use overwrite mode if overwrite-p is T; apply prefix-code first if it's non-nil."]) (fset 'vi-goto-command-state #[(&optional from-insert-state-p) " ! !" [use-local-map vi-com-map nil vi-insert-state from-insert-state-p overwrite-mode 0] 2 "\ Go to vi-mode command state. If optional arg exists, means return from insert state."]) (fset 'vi-kill-line #[(arg) " ! \"" [kill-line arg vi-set-last-change-command] 3 "\ kill specified number of lines (=d$), text saved in the kill ring." "*P"]) (fset 'vi-kill-region #[nil " !" [kill-region vi-set-last-change-command] 2 nil nil]) (fset 'vi-append-at-end-of-line #[(arg) " #" [vi-goto-insert-state arg (end-of-line) t] 4 "\ go to end of line and then go into vi insert state." "*p"]) (fset 'vi-change-rest-of-line #[(arg) " D#" [vi-goto-insert-state 1 kill-line arg t] 4 "\ Change the rest of (ARG) lines (= c$ in vi)." "*P"]) (fset 'vi-insert-before-first-nonwhite #[(arg) " #" [vi-goto-insert-state arg (back-to-indentation) t] 4 "\ (= ^i in vi)" "*p"]) (fset 'vi-open-above #[(arg) " D#" [vi-goto-insert-state 1 #[(x) "y\n!" [0 open-line x] 2] arg t] 4 "\ open new line(s) above current line and enter insert state." "*p"]) (fset 'vi-open-below #[(arg) " D#" [vi-goto-insert-state 1 #[(x) "\n!\ny" [nil open-line x] 2] arg t] 4 "\ open new line(s) and go into insert mode on the last line." "*p"]) (fset 'vi-insert-after #[(arg) " C#" [vi-goto-insert-state arg #[nil "l?u" [nil] 1] t] 4 "\ start vi insert state after cursor." "*p"]) (fset 'vi-insert-before #[(arg) " !" [vi-goto-insert-state arg] 2 "\ enter insert state before the cursor." "*p"]) (fset 'vi-goto-line #[(arg) " ! !!" [vi-raw-numeric-prefix arg end-of-buffer goto-line vi-prefix-numeric-value] 3 "\ Go to ARGth line." "P"]) (fset 'vi-beginning-of-buffer #[nil "eb" [] 1 "\ Move point to the beginning of current buffer." nil]) (fset 'vi-isearch-forward #[(arg) "` ! `U?ƪlj*" [arg isearch-forward-regexp isearch-forward opoint scmd call-interactively re-search-forward search-forward vi-search-last-command] 2 "\ Incremental search forward. Use regexp version if ARG is non-nil." "P"]) (fset 'vi-isearch-backward #[(arg) "` ! `U?ƪlj*" [arg isearch-backward-regexp isearch-backward opoint scmd call-interactively re-search-backward search-backward vi-search-last-command] 2 "\ Incremental search backward. Use regexp version if ARG is non-nil." "P"]) (fset 'vi-search-forward #[(arg string) " GV  lj$" [arg re-search-forward search-forward vi-search-last-command string 0 search-last-string nil 1] 5 "\ Nonincremental search forward. Use regexp version if ARG is non-nil." (byte-code "\"D\"D" [current-prefix-arg t read-string "regexp/" nil "/"] 4)]) (fset 'vi-search-backward #[(arg string) " GV  lj$" [arg re-search-backward search-backward vi-search-last-command string 0 search-last-string nil 1] 5 "\ Nonincremental search backward. Use regexp version if ARG is non-nil." (byte-code "\"D\"D" [current-prefix-arg t read-string "regexp?" nil "?"] 4)]) (fset 'vi-repeat-last-search #[(arg &optional search-command search-string) " \n  \"\nlj$" [search-command vi-search-last-command search-string search-last-string message "No last search command to repeat." ding nil arg] 5 "\ Repeat last search command. If optional search-command/string are given, use those instead of the ones saved." "p"]) (fset 'vi-reverse-last-search #[(arg &optional search-command search-string) " \n  \"=Ȫ=Ǫ=ʪ=\nˉ $" [search-command vi-search-last-command search-string search-last-string message "No last search command to repeat." ding re-search-forward re-search-backward search-forward search-backward nil arg] 5 "\ Redo last search command in reverse direction. If the optional search args are given, use those instead of the ones saved." "p"]) (fset 'vi-join-lines #[(arg) " !! !Y! Sr \"" [vi-raw-numeric-prefix arg delete-indentation t vi-prefix-numeric-value count 2 vi-set-last-change-command vi-join-lines] 4 "\ join ARG lines from current line (default 2), cleaning up white space." "P"]) (fset 'vi-backward-kill-line #[nil "??y!" [vi-insert-state 0 kill-line nil] 2 "\ kill the current line. Only works in insert state." nil]) (fset 'vi-abort-ins #[nil "??` V `\"!" [vi-insert-state vi-ins-point kill-region vi-goto-command-state t] 3 "\ abort insert state, kill inserted text and go back to command state." nil]) (fset 'vi-backward-windowfull #[(count) "V!Sr" [count 0 scroll-down nil] 3 "\ Backward COUNT windowfulls. Default is one." "p"]) (fset 'vi-scroll-down-window #[(count) " !" [count vi-scroll-amount scroll-up] 2 "\ Scrolls down window COUNT lines. If COUNT is nil (actually, non-integer), scrolls default amount. The given COUNT is remembered for future scrollings." "P"]) (fset 'vi-expose-line-below #[(count) " !" [scroll-up count] 2 "\ Expose COUNT more lines below the current window. Default COUNT is 1." "p"]) (fset 'vi-forward-windowfull #[(count) "V!Sr" [count 0 scroll-up nil] 3 "\ Forward COUNT windowfulls. Default is one." "p"]) (fset 'vi-next-line #[(count) "` !`U " [next-line this-command line-move count ding last-command] 3 "\ Go down count lines, try to keep at the same column." "p"]) (fset 'vi-next-line-first-nonwhite #[(count) "`y `U " [count back-to-indentation ding] 2 "\ Go down COUNT lines. Stop at first non-white." "p"]) (fset 'vi-previous-line-first-nonwhite #[(count) " ! " [previous-line count back-to-indentation] 2 "\ Go up COUNT lines. Stop at first non-white." "p"]) (fset 'vi-scroll-up-window #[(count) " !" [count vi-scroll-amount scroll-down] 2 "\ Scrolls up window COUNT lines. If COUNT is nil (actually, non-integer), scrolls default amount. The given COUNT is remembered for future scrollings." "P"]) (fset 'vi-expose-line-above #[(count) " !" [scroll-down count] 2 "\ Expose COUNT more lines above the current window. Default COUNT is 1." "p"]) (fset 'vi-char-argument #[(arg) " \n B\n\n B\n@ B)" [read-char char arg nil prefix-arg] 2 "\ Get following character (could be any CHAR) as part of the prefix argument. Possible perfix-arg cases are NIL, INTEGER, (NIL . CHAR) or (INTEGER . CHAR)." "P"]) (fset 'vi-goto-mark #[(mark-char &optional line-flag) " \n\" \"! !\n \"!\nb )" [char-equal mark-char last-command-char exchange-point-and-mark line-flag back-to-indentation 64 set-mark-command t vi-get-mark mark message "Mark register undefined." vi-ding nil] 4 "\ 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."]) (fset 'vi-goto-line-mark #[(char) " \"" [vi-goto-mark char t] 3 "\ Go to the line (at first non-white) marked by next char." "c"]) (fset 'vi-goto-char-mark #[(char) " !" [vi-goto-mark char] 2 "\ Go to the char position marked by next mark-char." "c"]) (fset 'vi-digit-argument #[(arg) "!! _! @Ī@_AB" [arg digit-argument nil prefix-arg 1] 2 "\ Set numeric prefix argument." "P"]) (fset 'vi-raw-numeric-prefix #[(arg) ":@" [arg] 1 "\ Return the raw value of numeric part prefix argument."]) (fset 'vi-prefix-numeric-value #[(arg) ":@@" [arg 1] 1 "\ Return numeric meaning of the raw prefix argument. This is a modification to the standard one provided in `callint.c' to handle (_ . CHAR) cases."]) (fset 'vi-reverse-last-find-char #[(count &optional find-arg) "  \"@[AB\"" [find-arg vi-last-find-char message "No last find char to repeat." ding vi-find-char count] 3 "\ Reverse last f F t T operation COUNT times. If the optional FIND-ARG is given, it is used instead of the saved one." "p"]) (fset 'vi-find-char #[(arg count) "@A@AA` \\ƍ b ," [arg direction char upto-flag pos exit-find-char (byte-code "f\"f\"\"f\"SU \nZ\"\n\\=" [pos throw exit-find-char nil char-equal 10 char count 0 upto-flag direction] 5) ding] 2 "\ Find in DIRECTION (1/-1) for CHAR of COUNT'th times on current line. If UPTO-FLAG is T, stop before the char. ARG = (DIRECTION.CHAR.UPTO-FLAG."]) (fset 'vi-repeat-last-find-char #[(count &optional find-arg) "  \"\"" [find-arg vi-last-find-char message "No last find char to repeat." ding vi-find-char count] 3 "\ Repeat last f F t T operation COUNT times. If optional FIND-ARG is given, it is used instead of the saved one." "p"]) (fset 'vi-backward-find-char #[(count char) " BB !" [-1 char nil vi-last-find-char vi-repeat-last-find-char count] 3 "\ Find the COUNT'th CHAR backward on current line." "p\nc"]) (fset 'vi-forward-find-char #[(count char) " BB !" [1 char nil vi-last-find-char vi-repeat-last-find-char count] 3 "\ Find the COUNT'th CHAR forward on current line." "p\nc"]) (fset 'vi-backward-upto-char #[(count char) " BB !" [-1 char t vi-last-find-char vi-repeat-last-find-char count] 3 "\ Find upto the COUNT'th CHAR backward on current line." "p\nc"]) (fset 'vi-forward-upto-char #[(count char) " BB !" [1 char t vi-last-find-char vi-repeat-last-find-char count] 3 "\ Find upto the COUNT'th CHAR forward on current line." "p\nc"]) (fset 'vi-end-of-word #[(count) "mu $ " [nil re-search-forward "\\W*\\w+\\>" t count backward-char] 5 "\ Move forward until encountering the end of a word. With argument, do this that many times." "p"]) (fset 'vi-replace-1-char #[(count char) " \"  ! #" [delete-char count nil char last-command-char self-insert-command vi-set-last-change-command vi-replace-1-char] 4 "\ Replace char after point by CHAR. Repeat COUNT times." "p\nc"]) (fset 'vi-replace-chars #[(arg) "! !" [overwrite-mode 1 vi-goto-insert-state arg] 2 "\ Replace chars over old ones." "*p"]) (fset 'vi-substitute-chars #[(count) " D#" [vi-goto-insert-state 1 #[(c) "``\\|" [c] 3] count t] 4 "\ Substitute COUNT chars by the input chars, enter insert state." "*p"]) (fset 'vi-substitute-lines #[(count) " SE#" [vi-goto-insert-state 1 vi-delete-op next-line count t] 5 "\ Substitute COUNT lines by the input chars. (=cc in vi)" "*p"]) (fset 'vi-prefix-char-value #[(arg) ":A" [arg nil] 1 "\ Get the char part of the current prefix argument."]) (fset 'vi-operator #[(arg) "" [vi-exit-op (byte-code "  !\"= !  !\" \"  !S !B#  #)" [last-command-char this-op-char read-char lookup-key vi-com-map char-to-string this-command vi-digit-argument arg prefix-arg char-equal vi-execute-op next-line vi-prefix-numeric-value vi-prefix-char-value] 7)] 2 "\ Handling vi operators (d/c//!/=/y). Current implementation requires the key bindings of the operators being fixed." "P"]) (fset 'vi-execute-op #[(op-char motion-command arg) "U \" ! #U \" ! E#U \" ! #U \" ! $U [# ! [$U # ! $U \" ! #U \"" [op-char 100 vi-delete-op motion-command arg vi-set-last-change-command vi-repeat-command-of 99 vi-goto-insert-state 1 nil 121 vi-yank-op 33 vi-shell-op vi-last-shell-command 60 vi-shift-op vi-shift-width 62 61 vi-indent-op 92 vi-narrow-op] 5 "\ Execute vi edit operator as specified by OP-CHAR, the operand is the region determined by the MOTION-COMMAND with ARG."]) (fset 'vi-repeat-command-of #[(command) "N=Ī\n=ƪ)" [command point-moving-unit cmd-type search vi-repeat-last-search find vi-repeat-last-find-char] 3 "\ Return the command for redo the given command."]) (fset 'vi-effective-range #[(motion-command arg) "` N` \"` U = B = ``X`` = = T =by` b!y` dVd B-" [nil motion-command point-moving-unit moving-unit opoint end begin arg prefix-arg command-execute line region mark match find 0 next-line 1] 5 "\ Return (begin . end) of the range spanned by executing the given MOTION-COMMAND with ARG. MOTION-COMMAND in ready-to-eval list form is not yet supported."]) (fset 'vi-delete-op #[(motion-command arg) " \n\"@ A U?\n! \"YX $ $," [vi-effective-range motion-command arg range begin end nil reg vi-prefix-char-value kill-region 65 90 append-to-register t copy-to-register] 6 "\ Delete range specified by MOTION-COMMAND with ARG."]) (fset 'vi-yank-op #[(motion-command arg) " \n\"@ A U?\n! \"YX $ $," [vi-effective-range motion-command arg range begin end nil reg vi-prefix-char-value copy-region-as-kill 65 90 append-to-register copy-to-register t] 6 "\ Yank (in vi sense) range specified by MOTION-COMMAND with ARG."]) (fset 'vi-yank-line #[(arg) " !S !B \" #" [vi-prefix-numeric-value arg vi-prefix-char-value vi-yank-op next-line vi-set-last-change-command] 4 "\ Yank (in vi sense) lines (= `yy' command)." "*P"]) (fset 'vi-string-end-with-nl-p #[(string) "GSHU" [string 10] 2 "\ See if STRING ends with a newline char. Used in checking whether the yanked text should be put back as lines or not."]) (fset 'vi-put-before #[(arg &optional after-p) " ! W V ! \"  Y X\nG  Z GZ\\ \n8) !; ! \" !!yyu`! c #*" [vi-prefix-char-value arg nil put-text reg 49 57 get-register error "Nothing in register %c" kill-ring ring-length yank this-command kill-ring-yank-pointer "Register %c is not containing text string" vi-string-end-with-nl-p after-p next-line 1 0 push-mark exchange-point-and-mark vi-set-last-change-command vi-put-before] 5 "\ 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." "P"]) (fset 'vi-put-after #[(arg) " \"" [vi-put-before arg t] 3 "\ Put yanked (in vi sense) text back after/below cursor." "P"]) (fset 'vi-shell-op #[(motion-command arg &optional shell-command) " \n\"@ A U?\"\n \n!?$+" [vi-effective-range motion-command arg range begin end shell-command read-string "!" nil vi-last-shell-command shell-command-on-region vi-prefix-char-value t] 7 "\ Perform shell command (as filter) on range specified by MOTION-COMMAND with ARG. If SHELL-COMMAND is not given, ask for one from minibuffer. If char argument is given, it directs the output to a *temp* buffer."]) (fset 'vi-shift-op #[(motion-command arg amount) " \n\"@ A U?\n!V\n!Z\n!Z #+" [vi-effective-range motion-command arg range begin end vi-prefix-char-value amount 0 48 indent-rigidly t] 5 "\ Perform shift command on range specified by MOTION-COMMAND with ARG for AMOUNT on each line. Negative amount means shift left. SPECIAL FEATURE: char argument can be used to specify shift amount(1-9)."]) (fset 'vi-indent-op #[(motion-command arg) " \n\"@ A U? #+" [vi-effective-range motion-command arg range begin end indent-region nil t] 5 "\ Perform indent command on range specified by MOTION-COMMAND with ARG."]) (fset 'vi-narrow-op #[(motion-command arg) " \n\"@ A U? }," [vi-effective-range motion-command arg range begin end nil reg] 4 "\ Narrow to region specified by MOTION-COMMAND with ARG."]) (fset 'vi-get-mark #[(char) " A" [char vi-mark-alist] 2 "\ Return contents of vi mark register named CHAR, or nil if undefined."]) (fset 'vi-set-mark #[(char) " \"! A`ē `!B B)" [char-equal char 64 set-mark-command nil vi-mark-alist aelt copy-marker] 4 "\ Set contents of vi mark register named CHAR to current point. '@' is the special anonymous mark register." "c"]) (fset 'vi-find-matching-paren #[nil "!!!!u! " [looking-at "[[({]" forward-sexp 1 backward-char "[])}]" backward-sexp ding] 2 "\ Locate the matching paren. It's a hack right now." nil]) (fset 'vi-backward-blank-delimited-word #[(count) " $o?u" [re-search-backward "[ \n`][^ \n`]+" nil t count 1] 5 "\ Backward COUNT blank-delimited words." "p"]) (fset 'vi-forward-blank-delimited-word #[(count) " $m?!" [re-search-forward "[^ \n]*[ \n]+[^ \n]" nil t count backward-char 1] 5 "\ Forward COUNT blank-delimited words." "p"]) (fset 'vi-end-of-blank-delimited-word #[(count) " $m?!" [re-search-forward "[^ \n']+[ \n']" nil t count backward-char 2] 5 "\ Forward to the end of the COUNT'th blank-delimited word." "p"]) (fset 'vi-home-window-line #[(arg) " S! " [move-to-window-line arg back-to-indentation] 2 "\ To window home or arg'th line from the top of the window." "p"]) (fset 'vi-last-window-line #[(arg) " [! " [move-to-window-line arg back-to-indentation] 2 "\ To window last line or arg'th line from the bottom of the window." "p"]) (fset 'vi-middle-window-line #[nil "! " [move-to-window-line nil back-to-indentation] 2 "\ To the middle line of the window." nil]) (fset 'vi-forward-word #[(count) " $Ç " [re-search-forward "\\w*\\W+\\<" nil t count vi-ding] 5 "\ Stop at the beginning of the COUNT'th words from point." "p"]) (fset 'vi-set-last-change-command #[(fun &rest args) " B" [fun args vi-last-change-command] 2 "\ Set (FUN . ARGS) as the last-change-command."]) (fset 'vi-redo-last-change-command #[(count &optional command) " ! V@A\" So" [command vi-last-change-command message "No last change command available." count 0 apply] 4 "\ Redo last change command COUNT times. If the optional COMMAND is given, it is used instead of the current last-change-command." "p"]) (fset 'vi-kill-char #[(count) " \" #" [delete-char count t vi-set-last-change-command] 4 "\ Kill COUNT chars from current point." "*p"]) (fset 'vi-transpose-objects #[(arg unit) " \"!  # \"! \"!! \"!! \"!! \"!!\"" [char-equal unit 63 message "Transpose: c(har), l(ine), p(aragraph), s(-exp), w(ord)," read-char vi-set-last-change-command vi-transpose-objects arg 99 transpose-chars 108 transpose-lines vi-prefix-numeric-value 112 transpose-paragraphs 115 transpose-sexps 119 transpose-words] 4 "\ Transpose objects, the following char specifies unit of objects to be transposed -- \"c\" for chars, \"l\" for lines, \"w\" for words, \"s\" for sexp, \"p\" for paragraph. For the use of the prefix-arg, refer to individual functions called." "*P\nc"]) (fset 'vi-query-replace #[(arg) " \")" [arg query-replace-regexp query-replace rcmd call-interactively nil] 3 "\ Query replace, use regexp version if ARG is non-nil." "*P"]) (fset 'vi-replace #[(arg) " \")" [arg replace-regexp replace-string rcmd call-interactively nil] 3 "\ Replace strings, use regexp version if ARG is non-nil." "*P"]) (fset 'vi-adjust-window #[(arg position) " \"! \"! \" ɥ!!  \"" [char-equal position 13 recenter 0 45 -1 46 window-height 2 message "Move current line to: \\r(top) -(bottom) .(middle)" read-char vi-adjust-window arg] 3 "\ Move current line to the top/center/bottom of the window." "p\nc"]) (fset 'vi-goto-column #[(col) "`y\nVltu\nSk\nUĪb )" [opoint 0 col 1 t ding] 3 "\ Go to given column of the current line." "p"]) (fset 'vi-name-last-change-or-macro #[(arg char) " !!! @= A@A@{8\n8 \n $, !! M" [arg name-last-kbd-macro intern char-to-string char vi-last-change-command vi-first-redo-insertion args str 2 overwrite-p 3 prefix-code vi-set-last-change-command vi-more-redo-insertion] 6 "\ 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." "P\nc"]) (fset 'vi-call-named-change-or-macro #[(count char) "\n!!K;\n!! \" \n!!K\"" [intern char-to-string char execute-kbd-macro count vi-redo-last-change-command] 5 "\ Execute COUNT times the keyboard macro definition named by the following CHAR." "p\nc"]) (fset 'vi-change-case #[(arg) "" [exit (byte-code "!`` \\\"!`` \\\" \" \" u" [looking-at "[a-z]" upcase-region arg "[A-Z]" downcase-region ding throw exit nil vi-set-last-change-command vi-change-case] 4)] 2 "\ Change the case of the char after point." "*p"]) (fset 'vi-ask-for-info #[(char) " \" \" \" !  !" [char-equal char 108 what-line 99 what-cursor-position 112 what-page message "Ask for: l(ine number), c(ursor position), p(age number)" read-char vi-ask-for-info] 3 "\ Inquire status info. The next CHAR will specify the particular info requested." "c"]) (fset 'vi-mark-region #[(arg region) " \" ! \" ! \" \" ! \" ! \" ! \" ! \" ! \" !!  \"" [char-equal region 100 mark-defun arg 115 mark-sexp 98 mark-whole-buffer 112 mark-paragraph 80 mark-page 102 mark-c-function 119 mark-word 101 mark-end-of-sentence 108 vi-mark-lines message "Mark: d(efun),s(-exp),b(uf),p(arag),P(age),f(unct),w(ord),e(os),l(ines)" read-char vi-mark-region] 3 "\ Mark region approriately. The next char REGION is d(efun),s(-exp),b(uffer), p(aragraph), P(age), f(unction in C/Pascal etc.), w(ord), e(nd of sentence), l(ines)." "p\nc"]) (fset 'vi-mark-lines #[(num) "y \n" [0 push-mark num] 1 "\ Mark NUM of lines from current line as current region."]) (fset 'vi-verify-spelling #[(arg unit) " \"! \"! \"! \"!!  \"" [arg prefix-arg char-equal unit 98 call-interactively spell-buffer 114 spell-region 115 spell-string 119 spell-word message "Spell check: b(uffer), r(egion), s(tring), w(ord)" read-char vi-verify-spelling] 3 "\ Verify spelling for the objects specified by char UNIT : [b(uffer), r(egion), s(tring), w(ord) ]." "P\nc"]) (fset 'vi-do-old-mode-C-c-command #[(arg) " !P\"Ǎ  \n \")" [lookup-key vi-mode-old-local-map "" char-to-string read-char cmd exit-vi-mode (byte-code " ‡  \")‡" [cmd ding nil vi-mode-old-case-fold case-fold-search arg prefix-arg command-execute] 3) vi-back-to-old-mode arg prefix-arg command-execute nil] 5 "\ This is a hack for accessing mode specific C-c commands in vi-mode." "P"]) (fset 'vi-quote-words #[(arg char) " !\"! o #!v c \" \" \" \" \" !u c" [string-match "[[({<\"'`*]" char-to-string char message "Enter any of [,{,(,<,\",',`,* as quoting character." read-char vi-set-last-change-command vi-quote-words arg looking-at "\\<" -1 char-equal 91 93 123 125 60 62 40 41 96 39 vi-end-of-word 1] 4 "\ Quote ARG words from the word point is on with the pattern specified by the CHAR. Currently, CHAR could be [,{,(,\",',`,<,*, etc." "*p\nc"]) (fset 'vi-locate-def #[nil "!w`!ux`{)!eb P#? #!)" [nil name vi-backward-blank-delimited-word 1 "^a-zA-Z" vi-end-of-blank-delimited-word set-mark-command re-search-forward "^(def[unvarconst ]*" t message "No definition for \"%s\" in current file." ding] 4 "\ Locate definition in current file for the name before the point. It assumes a `(def..' always starts at the beginning of a line." nil]) (fset 'vi-split-open-line #[(arg) " D#" [vi-goto-insert-state 1 #[(arg) "no?u\nVc c)\nSku)" [flag -1 arg 0 10 fill-prefix 1] 3] arg t] 4 "\ Insert a newline and leave point before it. With arg, inserts that many newlines." "*p"])