;ELC ;;; compiled by kwzh@nutrimat.gnu.ai.mit.edu on Sun Jul 21 15:30:17 1996 ;;; from file /gd/gnu/emacs/19.0/lisp/viper-keym.el ;;; emacs version 19.31.94.1. ;;; bytecomp version FSF 2.10 ;;; 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.29"))) (error "`viper-keym.el' was compiled for Emacs 19.29 or later")) (byte-code "!!  B!  B!)  B!7  B" [require viper-util boundp vip-vi-intercept-map make-sparse-keymap current-load-list vip-insert-intercept-map vip-emacs-intercept-map vip-overriding-map] 2) #@304 Keymap for user-defined local bindings. Useful for changing bindings such as ZZ in certain major modes. For instance, in letter-mode, one may want to bind ZZ to mh-send-letter. In a newsreader such as gnus, tin, or rn, ZZ could be bound to save-buffers-kill-emacs then post article, etc. (buffer local) (defvar vip-vi-local-user-map (make-sparse-keymap) (#$ . 717)) (byte-code "!#" [make-variable-buffer-local vip-vi-local-user-map put permanent-local t] 4) #@88 Keymap for user-defined global bindings. These bindings are seen in all Viper buffers. (defvar vip-vi-global-user-map (make-sparse-keymap) (#$ . 1189)) #@99 This is the main keymap in effect in Viper's Vi state. This map is global, shared by all buffers. (defvar vip-vi-basic-map (make-keymap) (#$ . 1347)) #@65 This keymap keeps keyboard macros defined via the :map command. (defvar vip-vi-kbd-map (make-sparse-keymap) (#$ . 1503)) #@149 This keymap is in use when the user asks Viper to simulate Vi very closely. This happens when vip-expert-level is 1 or 2. See vip-set-expert-level. (defvar vip-vi-diehard-map (make-sparse-keymap) (#$ . 1631)) #@87 Auxiliary map for per-buffer user-defined keybindings in Insert state. (buffer local) (defvar vip-insert-local-user-map (make-sparse-keymap) (#$ . 1846)) (byte-code "!#" [make-variable-buffer-local vip-insert-local-user-map put permanent-local t] 4) #@65 Auxiliary map for global user-defined bindings in Insert state. (defvar vip-insert-global-user-map (make-sparse-keymap) (#$ . 2110)) #@31 The basic insert-mode keymap. (defvar vip-insert-basic-map (make-sparse-keymap) (#$ . 2249)) #@180 Map used when user wants vi-style keys in insert mode. Most of the Emacs keys are suppressed. This map overshadows vip-insert-basic-map. Not recommended, except for novice users. (defvar vip-insert-diehard-map (make-keymap) (#$ . 2349)) #@56 This keymap keeps VI-style kbd macros for insert mode. (defvar vip-insert-kbd-map (make-sparse-keymap) (#$ . 2592)) #@36 Map used in Viper's replace state. (defvar vip-replace-map (make-sparse-keymap) (#$ . 2714)) #@64 Auxiliary map for global user-defined bindings in Emacs state. (defvar vip-emacs-global-user-map (make-sparse-keymap) (#$ . 2813)) #@55 This keymap keeps Vi-style kbd macros for emacs mode. (defvar vip-emacs-kbd-map (make-sparse-keymap) (#$ . 2950)) #@78 Auxiliary map for local user-defined bindings in Emacs state. (buffer local) (defvar vip-emacs-local-user-map (make-sparse-keymap) (#$ . 3070)) (byte-code "!#! B!$  B!3\nB!B\fB!Q Bˇ" [make-variable-buffer-local vip-emacs-local-user-map put permanent-local t boundp vip-empty-keymap make-sparse-keymap current-load-list vip-mode-map vip-vi-state-modifier-alist nil vip-insert-state-modifier-alist vip-emacs-state-modifier-alist] 4) #@17 (buffer local) (defvar vip-need-new-vi-local-map t (#$ . 3573)) (byte-code "!#" [make-variable-buffer-local vip-need-new-vi-local-map put permanent-local t] 4) #@17 (buffer local) (defvar vip-need-new-insert-local-map t (#$ . 3748)) (byte-code "!#" [make-variable-buffer-local vip-need-new-insert-local-map put permanent-local t] 4) #@17 (buffer local) (defvar vip-need-new-emacs-local-map t (#$ . 3931)) (byte-code "!#######################!X!\"#!T!)%#%#%#%,#%#%#%#%#7#7#7#7#<#<#<@#<΁A#<ρB#" "?" vip-search-backward "@" vip-register-macro "A" vip-Append "B" vip-backward-Word "C" vip-change-to-eol "D" vip-kill-line "E" vip-end-of-Word "F" vip-find-char-backward "G" vip-goto-line "H" vip-window-top "I" vip-Insert "J" vip-join-lines "K" vip-nil "L" vip-window-bottom "M" vip-window-middle "N" vip-search-Next "O" vip-Open-line "P" vip-Put-back "Q" vip-query-replace "R" vip-overwrite "S" vip-substitute-line "T" vip-goto-char-backward "U" vip-undo "V" find-file-other-window "W" vip-forward-Word "X" vip-delete-backward-char "Y" vip-yank-line "ZZ" vip-save-kill-buffer "\\" vip-escape-to-emacs "[" vip-brac-function "]" vip-ket-function "_" vip-alternate-ESC "^" vip-bol-and-skip-white "`" vip-goto-mark "a" vip-append "b" vip-backward-word "c" "d" "e" vip-end-of-word "f" vip-find-char-forward "g" "h" vip-backward-char "i" vip-insert "j" vip-next-line "k" vip-previous-line "l" "m" vip-mark-point "n" vip-search-next "o" vip-open-line "p" vip-put-back "q" "r" vip-replace-char "s" vip-substitute "t" vip-goto-char-forward "u" "v" find-file find-file-other-frame "w" vip-forward-word "x" vip-delete-char "y" "zH" vip-line-to-top "zM" vip-line-to-middle "zL" vip-line-to-bottom "z " "z." "z-" "{" vip-backward-paragraph "|" vip-goto-col "}" vip-forward-paragraph "~" vip-toggle-case global-set-key "" vip-escape-to-vi vip-vi-diehard-map redraw-display] 6) #@64 Keymap used to modify keys when Minibuffer is in Insert state. (defvar vip-minibuffer-map (make-sparse-keymap) (#$ . 8573)) (byte-code " # #! B##!4  B # #" [define-key vip-minibuffer-map " " vip-exit-minibuffer "\n" boundp vip-ex-cmd-map make-sparse-keymap current-load-list " " ex-cmd-read-exit " " ex-cmd-complete ex-read-filename-map vip-complete-filename-or-exit "!" vip-handle-!] 4) #@442 Override some vi-state or insert-state bindings in the current buffer. The effect is seen in the current buffer only. Useful for customizing mailer buffers, gnus, etc. STATE is 'vi-state, 'insert-state, or 'emacs-state ALIST is of the form ((key . func) (key . func) ...) Normally, this would be called from a hook to a major mode or on a per buffer basis. Usage: (vip-add-local-keys state '((key-str . func) (key-str . func)...))  (defalias 'vip-add-local-keys #[(state alist) "\n=\f M\n=0'   M\n=H ? \f \fM\n\" \" !)" [nil map state vi-state vip-need-new-vi-local-map make-sparse-keymap vip-vi-local-user-map insert-state vip-need-new-insert-local-map vip-insert-local-user-map emacs-state vip-need-new-emacs-local-map vip-emacs-local-user-map error "Invalid state in vip-add-local-keys: %S. Valid states: vi-state, insert-state or emacs-state" vip-modify-keymap alist vip-normalize-minor-mode-map-alist vip-set-mode-vars-for vip-current-state] 3 (#$ . 9022)]) #@213 Unconditionally reset Viper vip-*-local-user-map's. Rarely useful, but if u made a mistake by switching to a mode that adds undesirable local keys, e.g., comint-mode, then this function can return you to sanity. (defalias 'vip-zap-local-keys #[nil "    " [make-sparse-keymap vip-vi-local-user-map nil vip-need-new-vi-local-map vip-insert-local-user-map vip-need-new-insert-local-map vip-emacs-local-user-map vip-need-new-emacs-local-map vip-normalize-minor-mode-map-alist] 1 (#$ . 10063) nil]) #@572 Modify key bindings in a major-mode in a Viper state using a keymap. If the default for a major mode is emacs-state, then modifications to this major mode may not take effect until the buffer switches state to Vi, Insert or Emacs. If this happens, add vip-change-state-to-emacs to this major mode's hook. If no such hook exists, you may have to put an advice on the function that invokes the major mode. See vip-set-hooks for hints. The above needs not to be done for major modes that come up in Vi or Insert state by default. Arguments: (major-mode vip-state keymap) (defalias 'vip-modify-major-mode #[(mode state keymap) "=\n‚=Ă=   !\":  !\"L  B !BL !*" [state vi-state vip-vi-state-modifier-alist insert-state vip-insert-state-modifier-alist emacs-state vip-emacs-state-modifier-alist nil elt alist assoc mode eval delq keymap vip-normalize-minor-mode-map-alist vip-set-mode-vars-for vip-current-state] 5 (#$ . 10580)]) (defalias 'vip-debug-keymaps #[nil " \"!!\"! \"! \"! \"!\"!\"!\"!\"!\"!\"!\"!\"!\"!!\"!#\"!%\"!'\"!)\"!+\"!-\"!/\"!1\"!3\"!5\"!7\"!9\"!;\"!=\"!?\"!@A\"!BC\"!DE\"!FG\"!H!IJK!\"!LK\"!" [" *vip-debug*" princ format "Buffer name: %s\n\n" buffer-name "Variables: \n" "major-mode: %S\n" major-mode "vip-current-state: %S\n" vip-current-state "vip-mode-string: %S\n\n" vip-mode-string "vip-vi-intercept-minor-mode: %S\n" vip-vi-intercept-minor-mode "vip-insert-intercept-minor-mode: %S\n" vip-insert-intercept-minor-mode "vip-emacs-intercept-minor-mode: %S\n" vip-emacs-intercept-minor-mode "vip-vi-minibuffer-minor-mode: %S\n" vip-vi-minibuffer-minor-mode "vip-insert-minibuffer-minor-mode: %S\n\n" vip-insert-minibuffer-minor-mode "vip-vi-local-user-minor-mode: %S\n" vip-vi-local-user-minor-mode "vip-vi-global-user-minor-mode: %S\n" vip-vi-global-user-minor-mode "vip-vi-kbd-minor-mode: %S\n" vip-vi-kbd-minor-mode "vip-vi-state-modifier-minor-mode: %S\n" vip-vi-state-modifier-minor-mode "vip-vi-diehard-minor-mode: %S\n" vip-vi-diehard-minor-mode "vip-vi-basic-minor-mode: %S\n" vip-vi-basic-minor-mode "vip-replace-minor-mode: %S\n" vip-replace-minor-mode "vip-insert-local-user-minor-mode: %S\n" vip-insert-local-user-minor-mode "vip-insert-global-user-minor-mode: %S\n" vip-insert-global-user-minor-mode "vip-insert-kbd-minor-mode: %S\n" vip-insert-kbd-minor-mode "vip-insert-state-modifier-minor-mode: %S\n" vip-insert-state-modifier-minor-mode "vip-insert-diehard-minor-mode: %S\n" vip-insert-diehard-minor-mode "vip-insert-basic-minor-mode: %S\n" vip-insert-basic-minor-mode "vip-emacs-local-user-minor-mode: %S\n" vip-emacs-local-user-minor-mode "vip-emacs-kbd-minor-mode: %S\n" vip-emacs-kbd-minor-mode "vip-emacs-global-user-minor-mode: %S\n" vip-emacs-global-user-minor-mode "vip-emacs-state-modifier-minor-mode: %S\n" vip-emacs-state-modifier-minor-mode "\nvip-expert-level %S\n" vip-expert-level "vip-no-multiple-ESC %S\n" vip-no-multiple-ESC "vip-always %S\n" vip-always "vip-ex-style-motion %S\n" vip-ex-style-motion "vip-ex-style-editing-in-insert %S\n" vip-ex-style-editing-in-insert "vip-want-emacs-keys-in-vi %S\n" vip-want-emacs-keys-in-vi "vip-want-emacs-keys-in-insert %S\n" vip-want-emacs-keys-in-insert "vip-want-ctl-h-help %S\n" vip-want-ctl-h-help "\n\n\n" "Default value for minor-mode-map-alist: \n%S\n\n" default-value minor-mode-map-alist "Actual value for minor-mode-map-alist: \n%S\n"] 6 nil nil]) #@72 Add contents of mapsrc to mapdst. It is assumed that mapsrc is sparse. (defalias 'vip-add-keymap #[(mapsrc mapdst) " \" A\"" [vip-xemacs-p map-keymap #[(key binding) " \n #" [define-key mapdst key binding] 4] mapsrc mapcar #[(p) " @! A#" [define-key mapdst vector p] 4]] 3 (#$ . 14240)]) #@117 Modifies MAP with bindings specified in the ALIST. The alist has the form ((key . function) (key . function) ... ). (defalias 'vip-modify-keymap #[(map alist) "\n\"" [mapcar #[(p) " @! A#" [define-key map eval p] 4] alist] 3 (#$ . 14551)]) (provide (quote viper-keym))