;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:39:49 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/emulation/viper-macs.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`viper-macs.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\306\307!\210\310B\311B\312B\313B	\210\314\315!\210\314\316!\210\302B\317\302!\204* \320\303B\317\303!\2046 \320\304B\317\304!\204B \320\305B\317\305!\204N \320\321B\317\321!\204[ \320\320\207" [current-load-list noninteractive viper-last-macro-reg viper-vi-kbd-macro-alist viper-insert-kbd-macro-alist viper-emacs-kbd-macro-alist provide viper-macs viper-ex-work-buf viper-custom-file-name viper-current-state viper-fast-keyseq-timeout require viper-util viper-keym boundp nil viper-kbd-macro-parameters] 2)
#@76 Vector of keys representing the name of currently running Viper kbd macro.
(defvar viper-this-kbd-macro nil (#$ . 1177))
#@68 Vector of keys representing the name of last Viper keyboard macro.
(defvar viper-last-kbd-macro nil (#$ . 1304))
#@416 Prefix key for accessing previously typed Vi commands.

The previous command is accessible, as usual, via `.'.  The command before this
can be invoked as `<this key> 1', and the command before that, and the command
before that one is accessible as `<this key> 2'.
The notation for these keys is borrowed from XEmacs.  Basically,
a key is a symbol, e.g., `a', `\1', `f2', etc., or a list, e.g.,
`(meta control f1)'.
(custom-declare-variable 'viper-repeat-from-history-key ''f12 '(#$ . 1424) :type 'sexp :group 'viper)
(defalias 'ex-map #[nil "\306\307\211\211\211\310\213\210\311\f!\211@	A\f\nF\n\203' \312\313!\202` \314\315\316\f\317!#!\210\2038 \320 \210\321\307!\210\322\323\312#\210\322\323\312#\210\322\323\312#\210\324\325\317!\203^ \326\202_ \327#-\207" [ins map-args macro-body macro-name mod-char viper-kbd-macro-parameters "" nil ((byte-code "q\210\303\304!\203 \305\304\306u\210\303\207" [viper-ex-work-buf ins mod-char looking-at "!" t 1] 2)) ex-map-read-args viper-end-mapping-kbd-macro ignore ex-fixup-history format "map%s %S" viper-display-macro viper-change-state-to-insert start-kbd-macro define-key ")" message "Mapping %S in %s state.  Hit `C-x )' to complete the mapping" "Insert" "Vi" viper-vi-intercept-map viper-insert-intercept-map viper-emacs-intercept-map] 7])
(defalias 'ex-unmap #[nil "\304\305\211\211\306\213\210\307!\310\311	!!\312\313\314\315\n!#!\210\316	\203) \317\202* \320\",\207" [ins macro-name temp mod-char "" nil ((byte-code "q\210\303\304!\203 \305\304\306u\210\303\207" [viper-ex-work-buf ins mod-char looking-at "!" t 1] 2)) ex-unmap-read-args viper-fixup-macro vconcat ex-fixup-history format "unmap%s %S" viper-display-macro viper-unrecord-kbd-macro insert-state vi-state] 6])
(defalias 'ex-map-read-args #[(variant) "\306\307\310\211\211\211\211\211\211%&'\310\311\312\217\210\n\2039 \313\n!\204\251 \n;\2030 \314\n!\202\251 \314\315\n!!\202\251 \303\316(\"\210\317\320!\210\321\235\204\246 \314&\203V \322!\202W \323\"&\324\235\203l \325&\326&G\320Z#&\327\330(&G\326V\203\201 \315\331&!!\202\202 \332#\303!\210\333 \334\f!\203\236 \303\335\"\210\317\320!\210\310\202\241 \336\f!\211\202D &\nG\326U\203\264 \337\340!\210\341\n!\342\n!\203\302 \343\n!	\203\335 \342	!\203\323 \343	!\202\335 \313	!\204\335 \337\344!\210\310'\317\326!\210\n	.	B\207" [args macro-body macro-name message event key t [] nil (byte-code "\304\305\306\"\307P\310!\211@\310	A\"@\304\207" [args temp macro-name macro-body ex-get-inline-cmd-args ".*map[!]*[ 	]?" "\n" " nil nil " read-from-string] 4) ((error (byte-code "\300\301\302\"\207" [signal error ("map: Macro name and body must be a quoted string or a vector")] 3))) vectorp vconcat prin1-to-string ":map%s <Name>" sit-for 2 (13 10 (control m) (control j) return linefeed) vector [] (8 127 '^\? '^H (control h) (control \?) backspace delete) subseq 0 format ":map%s %s" viper-display-macro "" viper-read-key viper-mouse-event-p "%s (No mouse---only keyboard keys, please)" viper-event-key error "Can't map an empty macro name" viper-fixup-macro viper-char-array-p viper-char-array-to-macro "map: Invalid syntax in macro definition" temp key-seq cursor-in-echo-area variant] 10])
(defalias 'ex-unmap-read-args #[(variant) "\306\307\230\203 	\202\f \n\310\211\211\211\211\211\211\211\211\211\211\f%&'()*+,-\311\312!\211G\313V\204\324 \314\315\"\210\316\317!\210\320\235\204\322 \321\f\203T \322!\202U \323\"\324\235\203i \325\f\313\fG\317Z#\202\225 \326\235\203\225 \325\f\313\fGS#\327\330\fG\313V\203\211 \331\332\f!!\202\212 \333#\f\334\f,\f#\327\330\fG\313V\203\247 \331\332\f!!\202\250 \333#\f\314\f!\210\335 %\336%!\203\311 \314\337\f\"\210\316\317!\210\310\202\315 \340%!\211\202C \fG\313U\203\337 \341\342!\210\313\234\343>\203\356 \344!@\202\361 \321!.\207" [variant viper-insert-kbd-macro-alist viper-vi-kbd-macro-alist macro-name key-seq key t "!" nil ex-get-inline-cmd-args ".*unma?p?[!]*[ 	]*" 0 message ":unmap%s <Name>" sit-for 2 (13 10 (control m) (control j) return linefeed) vconcat vector [] (8 127 '^\? '^H (control h) (control \?) backspace delete) subseq (tab (control i) 9) format ":unmap%s %s" prin1-to-string viper-display-macro "" viper-do-sequence-completion viper-read-key viper-mouse-event-p "%s (No mouse---only keyboard keys, please)" viper-event-key error "Can't unmap an empty macro name" (91 34) read-from-string event viper-emacs-intercept-minor-mode viper-insert-intercept-minor-mode viper-vi-intercept-minor-mode viper-emacs-kbd-minor-mode viper-insert-kbd-minor-mode viper-vi-kbd-minor-mode macro-alist cursor-in-echo-area] 14])
(defalias 'viper-end-mapping-kbd-macro #[(&optional ignore) "\306\307\310#\210\306	\307\310#\210\306\n\307\310#\210\204\" \f\203 \204\" \311\312!\210\fA@\f@\313\f8\314\f8\310\204H \315\310!\210\316!\317 \210\320\203T \321\202U \322\323!#\210\324\325\326\323!\323!$!,\207" [viper-vi-intercept-map viper-insert-intercept-map viper-emacs-intercept-map ignore viper-kbd-macro-parameters defining-kbd-macro define-key ")" nil error "Not mapping a kbd-macro" 2 3 end-kbd-macro viper-events-to-macro viper-change-state-to-vi viper-record-kbd-macro insert-state vi-state viper-display-macro ex-fixup-history format "map%s %S %S" macro-body macro-name ins mod-char last-kbd-macro] 7 nil nil])
#@501 Record a Vi macro.  Can be used in `.viper' file to define permanent macros.
MACRO-NAME is a string of characters or a vector of keys.  STATE is
either `vi-state' or `insert-state'.  It specifies the Viper state in which to
define the macro.  MACRO-BODY is a string that represents the keyboard macro.
Optional SCOPE says whether the macro should be global (t), mode-specific
(a major-mode symbol), or buffer-specific (buffer name, a string).
If SCOPE is nil, the user is asked to specify the scope.
(defalias 'viper-record-kbd-macro #[(macro-name state macro-body &optional scope) "\306\306\n\307=\203 \310\311\202% \n\312>\203  \313\f\314\202% \315\3166\3067\3068\3069\306:\306;\306<\306=>G\317U\203H \320\321!\210\322>!>\323>!\203[ \324>!>\322?!?\323?!\203n \324?!?@\325=\204H@;\204H@\203\206 @9\204H\326\327\330\331 \"!\203\273 \327\332\333>!\334\327\335\333?!\211;\"\336\337\211;;\203\256 \340\202\257 \341%\331 %:\331 \202\326\327\342A\"!\203\360 \327\343\333>!\334\327\335\333?!\211;\"\336\337\211?;\203\343 \340\202\344 \341%A%:A\202\327\344\333>!\334\327\335\333?!\211;\"\336\337\211?;\203\340\202\341%$:\325@\326\327\345\346B!\"!\203C\347\327\350\333>!\n\351?!\203:\327\335?\"\202<?@%B\"\210\352:!\210>@\325=\203Z\306\211\325\306BE\202}@9\203m\306@\306BC\325\306BE\202}@;\205}@\306BC\306\325\306BEB7\353>\3546!\"\2118\204\333\355	\356\357>\317H!!\360#\210\3546!\211<\203\304\361<@@!\361>!\231\203\304<@=B=<A\211<\204\245\362=!=6\363=7<B\"L\21078@\325=\203\351\36488\202@9\203\372\353@\36588\"\202@;\205\353@8A@\"\2119\2039?\241\202B@9\203.8AA@?B\36588B\240\202B@;\205B8A@?B8A@B\240.\n\207" [state-name keymap state viper-vi-kbd-map viper-insert-kbd-map viper-emacs-kbd-map nil vi-state "Vi state" viper-vi-kbd-macro-alist (insert-state replace-state) "Insert state" viper-insert-kbd-macro-alist "Emacs state" viper-emacs-kbd-macro-alist 0 error "Can't map an empty macro name" viper-fixup-macro viper-char-array-p viper-char-array-to-macro t y-or-n-p format "Map this macro for buffer `%s' only? " buffer-name "%S is mapped to %s for %s in `%s'" viper-display-macro viper-abbreviate-string "%S" 14 "" "  ....\"" "  ....]" "Map this macro for the major mode `%S' only? " "%S is mapped to %s for %s in `%S'" "%S is globally mapped to %s in %s" "Save this macro in %s? " viper-abbreviate-file-name viper-save-string-in-file "\n(viper-record-kbd-macro %S '%S %s '%S)" vectorp message assoc eval define-key vector viper-key-to-emacs-key viper-exec-mapped-kbd-macro viper-array-to-string reverse append 3 2 macro-alist-var new-elt old-elt old-sub-elt msg temp lis lis2 macro-name macro-body scope major-mode viper-custom-file-name] 10 (#$ . 6815)])
#@369 Delete macro MACRO-NAME from Viper STATE.
MACRO-NAME must be a vector of viper-style keys.  This command is used by Viper
internally, but the user can also use it in ~/.viper to delete pre-defined
macros supplied with Viper.  The best way to avoid mistakes in macro names to
be passed to this function is to use viper-describe-kbd-macros and copy the
name from there.
(defalias 'viper-unrecord-kbd-macro #[(macro-name state) "\306\306\n\307=\203 \310\311\202% \n\312>\203  \313\f\314\202% \315\316)\306*\306+\306,\306-\306.\317/!/\320/!\203I \321/!/\322/\323)!\"./G\324U\203_ \325\326!\210.\204o \325\327\330/!\331 $\210\322\331 .A@\"*\3220\332.8\"+\333.8,*A\203\273 +A\204\233 ,A\203\251 \334\335\336\330/!\331 #!\203\273 *-\337\340\330/!\331 $\210\202	+A\203\347 ,A\203\325 \334\335\341\330/!0#!\203\347 +-\337\342\330/!0$\210\202	\333.8\211-A\203\376 \337\343\330/!#\210\202	\325\327\330/!\331 $\210-\306\241\210*A\206E+A\206E,A\206E)\344.\323)!\"L\210\345/\324H\323)!\"\205E\346	\347\350/\324H!!\306#.\207" [state-name keymap state viper-vi-kbd-map viper-insert-kbd-map viper-emacs-kbd-map nil vi-state "Vi state" viper-vi-kbd-macro-alist (insert-state replace-state) "Insert state" viper-insert-kbd-macro-alist "Emacs state" viper-emacs-kbd-macro-alist viper-fixup-macro viper-char-array-p viper-char-array-to-macro assoc eval 0 error "Can't unmap an empty macro name" "%S is not mapped to a macro for %s in `%s'" viper-display-macro buffer-name 2 3 y-or-n-p format "Unmap %S for `%s' only? " message "%S is unmapped for %s in `%s'" "Unmap %S for the major mode `%S' only? " "%S is unmapped for %s in %S" "Global mapping for %S in %s is removed" delq viper-can-release-key define-key vector viper-key-to-emacs-key macro-alist-var buf-mapping mode-mapping global-mapping macro-pair macro-entry macro-name major-mode] 6 (#$ . 9625)])
(defalias 'viper-can-release-key #[(char macro-alist) "\305\306\211\203# \n\203# @@\f	\307H=\203 \306A\211\204\n \n+\207" [macro-alist macro-name can-release lis char t nil 0] 4])
#@21 Dispatch kbd macro.
(defalias 'viper-exec-mapped-kbd-macro #[(count) "\306=\203\n 	\202 \307>\203 \n\202 \310\311\311\311\311\311\311 \311!\311\"\311#\311$%!\312!\f\" \313 !\314\f\"\"\315\f\"\"\204g @\"\316 A\"\"\203\221 \314\317 \"A@\"A\211#\204\221 \314&\320\"8\"A\211#\204\221 \321\"8A##\203\274 '\204\274 ((\"@)\322\323#!*\"\210\311)\"@+\324!)\202\342 \324 !\210,\204\312 *,\325\326\311!!$\327$!\203\337 \330$!\202\342 \331\332!.\f\207" [viper-current-state viper-vi-kbd-macro-alist viper-insert-kbd-macro-alist viper-emacs-kbd-macro-alist macro-alist unmatched-suffix vi-state (insert-state replace-state) "" nil viper-read-fast-keysequence viper-events-to-macro assoc viper-find-best-matching-macro subseq buffer-name 2 3 execute-kbd-macro viper-macro-to-events viper-set-unread-command-events key-binding read-key-sequence commandp command-execute beep 1 viper-vi-kbd-minor-mode viper-insert-kbd-minor-mode viper-emacs-kbd-minor-mode next-best-match keyseq event-seq macro-first-char macro-alist-elt macro-body command last-command-event major-mode defining-kbd-macro command-history viper-this-kbd-macro count viper-last-kbd-macro prefix-arg] 4 (#$ . 11735) "P"])
#@41 Show currently defined keyboard macros.
(defalias 'viper-describe-kbd-macros #[nil "\303\220\304\305!\210\306\307\"\210\304\310!\210\306\307	\"\210\304\311!\210\306\307\n\"\221\207" [viper-vi-kbd-macro-alist viper-insert-kbd-macro-alist viper-emacs-kbd-macro-alist " *viper-info*" princ "Macros in Vi state:\n===================\n" mapcar viper-describe-one-macro "\n\nMacros in Insert and Replace states:\n====================================\n" "\n\nMacros in Emacs state:\n======================\n"] 4 (#$ . 12985) nil])
(defalias 'viper-describe-one-macro #[(macro) "\301\302\303\304@!\"!\210\301\305!\210A@\203 \306\307A@\"\210\202\" \301\310!\210\301\311!\210\3128\2036 \306\307\3128\"\210\202: \301\310!\210\301\313!\210\3148A\203R \301\302\315\3148A\"!\210\202V \301\316!\210\301\317!\207" [macro princ format "\n  *** Mappings for %S:\n      ------------\n" viper-display-macro "   ** Buffer-specific:" mapcar viper-describe-one-macro-elt "  none\n" "\n   ** Mode-specific:" 2 "\n   ** Global:" 3 "\n           %S" "  none" "\n"] 5])
(defalias 'viper-describe-one-macro-elt #[(elt) "@A\303\304\305\n	#!*\207" [elt defn name princ format "\n       * %S:\n           %S\n"] 5])
(defalias 'viper-keyseq-is-a-possible-macro #[(seq alist) "\303!\304\305\306\307\310\n!\"B!)\207" [seq converted-seq alist viper-events-to-macro eval or mapcar #[(elt) "\302	\"\207" [converted-seq elt viper-prefix-subseq-p] 3] viper-this-buffer-macros] 6])
(defalias 'viper-prefix-subseq-p #[(seq1 seq2) "G	G\211\nX\205 \304	\305#\232*\207" [seq1 seq2 len2 len1 subseq 0] 6])
(defalias 'viper-common-seq-prefix #[(&rest seqs) "@A\306\307\310G\307U\203 \307\202  \311\312\313\314\"\"\fW\203A \315\316\313\317\n\"B!\203: \320\321	\f\234!\"\fT\211\202! -\207" [seqs first rest pref idx len [] 0 nil apply min mapcar length eval and #[(s) "	\234\n	\234\232\207" [first idx s] 3] vconcat vector] 6])
(defalias 'viper-extract-matching-alist-members #[(pref alist) "\301\302\303\304\305!\"\"\207" [alist delq nil mapcar #[(elt) "\302	\"\205 	\207" [pref elt viper-prefix-subseq-p] 3] viper-this-buffer-macros] 6])
(defalias 'viper-do-sequence-completion #[(seq alist compl-message) "\305	\"\306\307\n\"\232\203# \nG\310U\203# \311\312\f\"\210\313\314!\210\202U \n\2045 \311\315\f\"\210\313\314!\210\202U \n\235\203K \311\316\f\"\210\313\314!\210\317\n!\210\202U \232\203U \317\n!\210*\207" [seq alist matches new-seq compl-message viper-extract-matching-alist-members apply viper-common-seq-prefix 1 message "%s (Sole completion)" sit-for 2 "%s (No match)" "%s (Complete, but not unique)" viper-display-vector-completions] 3])
(defalias 'viper-display-vector-completions #[(list) "\301\220\302\303\304\303\305\"\"!\221\207" [list "*Completions*" display-completion-list mapcar prin1-to-string viper-display-macro] 7])
(defalias 'viper-find-best-matching-macro #[(alist str) "\306	G\307\211\211\211\204_ \203_ @\211@GY\203W \n@\310	\306#\232\203W \311\312 \nA@\"A\204U \311\313\n8\"A\204U \314\n8A\203W \315A\202 \203k \n\202o \307\306\f.B\207" [alist str macro-def found unmatched-start-idx match 0 nil subseq assoc buffer-name 2 3 t str-len def-len lis major-mode] 8])
(defalias 'viper-this-buffer-macros #[(macro-alist) "\302\303\304	\"\305\302\"\211)\207" [candidates macro-alist nil mapcar #[(elt) "\302\303 A@\"A\204 \302	\3048\"A\204 \3058A\205 @\207" [elt major-mode assoc buffer-name 2 3] 4] delq] 3])
(defalias 'viper-display-macro #[(macro-name-or-body) "\301!\203\f \302\303\304#\207\305!\203 \302\306\304#\207\207" [macro-name-or-body viper-char-symbol-sequence-p mapconcat symbol-name "" viper-char-array-p char-to-string] 4])
(defalias 'viper-events-to-macro #[(event-seq) "\301\302\303\304\305\"\"!\207" [event-seq vconcat delq nil mapcar #[(elt) ":?\205	 \301!\207" [elt viper-event-key] 2]] 6])
(defalias 'viper-char-array-to-macro #[(array) "\304!\305\203 \306\307\n\"\202 \n\304\306\310	\"!*\207" [array macro vec viper-xemacs-p vconcat nil mapcar character-to-event viper-event-key] 4])
(defalias 'viper-fixup-macro #[(macro) "G\305\306\211\307!\204 <\203u \fW\203u 	\204u \234\211\247\203[ \305\nX\203n \n\310X\203n \311!\203G \312\313\n\314\\!!I\210\202n <\203n \233\312\313\n\314\\!!\240\210\202n \n<\203g \315\n!\210\202n \n9\204n \316T\211\202 	\203\200 \317\320\n\"\202\201 ,\207" [macro break elt idx len 0 nil vectorp 9 arrayp intern char-to-string 48 viper-fixup-macro t error "Wrong type macro component, symbol-or-listp, %S"] 7])
(defalias 'viper-char-array-p #[(array) "\301\302\303\304\"B!\207" [array eval and mapcar viper-characterp] 5])
(defalias 'viper-macro-to-events #[(macro-body) "\301\302\303\"!\207" [macro-body vconcat mapcar viper-key-to-emacs-key] 4])
(defalias 'viper-char-symbol-sequence-p #[(vec) "\301!\205 \302\303\304\305\"B!\207" [vec sequencep eval and mapcar #[(elt) "9\205 \301!G\302U\207" [elt symbol-name 1] 2]] 5])
(defalias 'viper-event-vector-p #[(vec) "\301!\205 \302\303\304\305\"B!\207" [vec vectorp eval and mapcar #[(elt) "\211\250\206! 	9\203 	\302N\206! 	:\205! 	@9\205! 	@\302N)\205& \303\207" [elt obj event-symbol-elements t] 3]] 5])
(defalias 'viper-read-fast-keysequence #[(event macro-alist) "\306!\307\310\311!\203 \f\202 \312\"\2042 \313\n\"\2032 \314 \315	!\204 \316\n\306	!\"\202 \n*\207" [event next-event lis last-input-event viper-ESC-keyseq-timeout viper-fast-keyseq-timeout vector nil viper-sit-for-short viper-ESC-event-p t viper-keyseq-is-a-possible-macro viper-read-key viper-mouse-event-p vconcat macro-alist] 4])
(defalias 'viper-set-register-macro #[(reg) "\302!\203 \303\304!\204 \305\306!\210\307	\"\207" [reg last-kbd-macro get-register y-or-n-p "Register contains data.  Overwrite? " error "Macro not saved in register.  Can still be invoked via `C-x e'" set-register] 3])
#@54 Keyboard macros in registers - a modified @ command.
(defalias 'viper-register-macro #[(count) "\304 \227\305X\203( \306X\203( \n\203 \307 \210\310!\202y \311\312!\"\202y \313U\204: \314U\204: \315U\203K 	\204B \316\317!\210\311\312	!\"\202y \320U\203W \321!\202y \322U\203u \304 \227\305X\205y \306X\205y \310!\202y \316\323\")\207" [reg viper-last-macro-reg defining-kbd-macro count read-char 97 122 end-kbd-macro viper-set-register-macro execute-kbd-macro get-register 64 10 13 error "No previous kbd macro" 35 start-kbd-macro 33 "`%c': Unknown register"] 3 (#$ . 18914) "P"])
#@54 Call last keyboad macro for each line in the region.
(defalias 'viper-global-execute #[nil "`\300\301!V\203 \302 \210\303 \210\304 \210`\300\301!W\205% \305y\210\303 \210\304 \210\202 \207" [mark t exchange-point-and-mark beginning-of-line call-last-kbd-macro 1] 3 (#$ . 19523)])
