;ELC ;;; compiled by kwzh@hal.gnu.ai.mit.edu on Tue May 3 21:48:04 1994 ;;; from file /gd/gnu/emacs/19.0/lisp/edmacro.el ;;; emacs version 19.22.92.2. ;;; 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"))) (error "`/gd/gnu/emacs/19.0/lisp/edmacro.el' was compiled for Emacs 19")) (require (quote cl)) (defvar edmacro-eight-bits nil "\ *Non-nil if edit-kbd-macro should leave 8-bit characters intact. Default nil means to write characters above \\177 in octal notation.") (byte-code "!   # #‡" [boundp edmacro-mode-map nil make-sparse-keymap define-key "" edmacro-finish-edit "" edmacro-insert-key] 4) (defalias 'edit-kbd-macro #[(keys &optional prefix finish-hook store-hook) "<!! s =,ȝF :!:  @s =V!Ks =d s 9o Ks \f!~ \"!p\f!\"?\"!!!!! &!')+!L!/L!L  ! \f\"A@\"c)c)!\f=3@!AB!." [keys arrayp key-binding nil mac cmd store-hook call-last-kbd-macro (" " [return]) last-kbd-macro y-or-n-p "No keyboard macro defined. Create one? " keyboard-quit "" execute-extended-command read-command "Name of keyboard macro to edit: " view-lossage recent-keys error "Not a keyboard macro: %s" message "Formatting keyboard macro..." oldbuf edmacro-fix-menu-commands mmac edmacro-format-keys 1 fmt prefix fmtv get-buffer-create "*Edit Macro*" buf "Formatting keyboard macro...done" switch-to-buffer kill-all-local-variables use-local-map edmacro-mode-map buffer-read-only edmacro-mode major-mode "Edit Macro" mode-name make-local-variable edmacro-original-buffer edmacro-finish-hook finish-hook edmacro-store-hook erase-buffer ";; Keyboard Macro Editor. Press C-c C-c to finish; " "press C-x k RET to cancel.\n" ";; Original keys: " "\n" "\nCommand: " symbol-name "none" where-is-internal (keymap) "Key: " "Key: none\n" "\nMacro:\n\n" recenter (4) set-buffer-modified-p run-hooks edmacro-format-hook] 5 "\ Edit a keyboard macro. At the prompt, type any key sequence which is bound to a keyboard macro. Or, type `C-x e' or RET to edit the last keyboard macro, `C-h l' to edit the last 100 keystrokes as a keyboard macro, or `M-x' to edit a macro by its command name. With a prefix argument, format the macro in a more concise way." "kKeyboard macro to edit (C-x e, M-x, C-h l, or keys): \nP"]) (defalias 'edit-last-kbd-macro #[(&optional prefix) "\n\"" [edit-kbd-macro call-last-kbd-macro prefix] 3 "\ Edit the most recently defined keyboard macro." "P"]) (defalias 'edit-named-kbd-macro #[(&optional prefix) "\n\"" [edit-kbd-macro execute-extended-command prefix] 3 "\ Edit a keyboard macro which has been given a name by `name-last-kbd-macro'." "P"]) (defalias 'read-kbd-macro #[(start &optional end) ";\n\n\"\n{!" [start edmacro-parse-keys end last-kbd-macro] 3 "\ Read the region as a keyboard macro definition. The region is interpreted as spelled-out keystrokes, e.g., \"M-x abc RET\". See documentation for `edmacro-mode' for details. Leading/trailing \"C-x (\" and \"C-x )\" in the text are allowed and ignored. The resulting macro is installed as the \"current\" keyboard macro. In Lisp, may also be called with a single STRING argument in which case the result is returned rather than being installed as the current macro. The result will be a string if possible, otherwise an event vector. Second argument NEED-VECTOR means to return an event vector always." "r"]) (defalias 'format-kbd-macro #[(&optional macro verbose) "\f9\fK\n \"" [macro edmacro-format-keys last-kbd-macro verbose] 3 "\ Return the keyboard macro MACRO as a human-readable string. This string is suitable for passing to `read-kbd-macro'. Second argument VERBOSE means to put one command per line with comments. If VERBOSE is `1', put everything on one line. If VERBOSE is omitted or nil, use a compact 80-column format."]) (defalias (quote edmacro-finish-edit) #[nil "=\n!!Ɖe \nb !!s6!єѕ{Ӛo\"?P!\n\n!o\nK!o\n#!o )!!єѕ{!!Ӛ!\"! B !!$$!$!$!$K!!\"#! ))!bm!y!`)p+d{ -./0 1\n6 606Ӛ6!- /!F/q!!6!0b06!\n=x6GVs68\n\n6GU\n!\n6M\n\n\"<!<:<@!!!!>:>@!!!>A>* ?!?:?@!@!\n6\"?A?*)A+!/!5B/!1=1 .\n" [major-mode edmacro-mode error "This command is valid only in buffers created by `edit-kbd-macro'" run-hooks edmacro-finish-hook nil top no-keys keys cmd case-fold-search looking-at "[ ]*\\($\\|;;\\|REM[ \n]\\)" "Command:[ ]*\\([^ \n]*\\)[ ]*$" edmacro-store-hook "\"Command\" line not allowed in this context" 1 str "" equalp "none" intern fboundp arrayp y-or-n-p format "Command %s is already defined; %s" "proceed? " keyboard-quit "Key:\\(.*\\)$" "\"Key\" line not allowed in this context" edmacro-parse-keys key t key-binding b commandp "Key %s is already defined; %s" edmacro-format-keys "Macro:[ \n]*" 0 "Expected a `Macro:' line" buf buffer-modified-p modp edmacro-original-buffer obuf store-hook finish-hook "No command name or keys specified" buffer-name message "Compiling keyboard macro..." mac "Compiling keyboard macro...done" last-kbd-macro fmakunbound where-is-internal (keymap) G40200 global-unset-key G40201 G40202 global-set-key kill-buffer switch-to-buffer] 7 nil nil]) (defalias 'edmacro-insert-key #[(key) "n\f \"ñ !ı" [edmacro-format-keys key t "\n" " "] 3 "\ Insert the written name of a key in the buffer." "kKey to insert: "]) (defalias 'edmacro-mode #[nil "!" [error "This mode can be enabled only by `edit-kbd-macro'"] 2 "\ \\Keyboard Macro Editing mode. Press \\[edmacro-finish-edit] to save and exit. To abort the edit, just kill this buffer with \\[kill-buffer] RET. Press \\[edmacro-insert-key] to insert the name of any key by typing the key. The editing buffer contains a \"Command:\" line and any number of \"Key:\" lines at the top. These are followed by a \"Macro:\" line and the macro itself as spelled-out keystrokes: `C-x C-f foo RET'. The \"Command:\" line specifies the command name to which the macro is bound, or \"none\" for no command name. Write \"last-kbd-macro\" to refer to the current keyboard macro (as used by \\[call-last-kbd-macro]). The \"Key:\" lines specify key sequences to which the macro is bound, or \"none\" for no key bindings. You can edit these lines to change the places where the new macro is stored. Format of keyboard macros during editing: Text is divided into \"words\" separated by whitespace. Except for the words described below, the characters of each word go directly as characters of the macro. The whitespace that separates words is ignored. Whitespace in the macro must be written explicitly, as in \"foo SPC bar RET\". * The special words RET, SPC, TAB, DEL, LFD, ESC, and NUL represent special control characters. The words must be written in uppercase. * A word in angle brackets, e.g., , , or , represents a function key. (Note that in the standard configuration, the function key and the control key RET are synonymous.) You can use angle brackets on the words RET, SPC, etc., but they are not required there. * Keys can be written by their ASCII code, using a backslash followed by up to six octal digits. This is the only way to represent keys with codes above \\377. * One or more prefixes M- (meta), C- (control), S- (shift), A- (alt), H- (hyper), and s- (super) may precede a character or key notation. For function keys, the prefixes may go inside or outside of the brackets: C- = . The prefixes may be written in any order: M-C-x = C-M-x. Prefixes are not allowed on multi-key words, e.g., C-abc, except that the Meta prefix is allowed on a sequence of digits and optional minus sign: M--123 = M-- M-1 M-2 M-3. * The `^' notation for control characters also works: ^M = C-m. * Double angle brackets enclose command names: <> is shorthand for M-x next-line RET. * Finally, REM or ;; causes the rest of the line to be ignored as a comment. Any word may be prefixed by a multiplier in the form of a decimal number and `*': 3* = , and 10*foo = foofoofoofoofoofoofoofoofoofoo. Multiple text keys can normally be strung together to form a word, but you may need to add whitespace if the word would look like one of the above notations: `; ; ;' is a keyboard macro with three semicolons, but `;;;' is a comment. Likewise, `\\ 1 2 3' is four keys but `\\123' is a single key written in octal, and `< right >' is seven keys but `' is a single function key. When in doubt, use whitespace." nil]) (byte-code "#\"\"\"" [put edmacro-mode mode-class special defalias edmacro-format-keys #[(macro &optional verbose) " ! D\"\n !̂\" \"=C ;~ GW}HYsH\"Z\\I\\Q*H=fHH\n>#!>H\nA>TH>?#Q\")H=;!=;H=TH>?7+,+S+Y,,P,,*\")H=!=H=^TH>pT^H>?#Q\")145674:4@55\"667B74A47,#99#:;<=>56@A>:>@55:\"6?\f6A?@>A>A-B\";;<<#=B=\";C56DEC:C@55;\"66<9=:6EωDCAC\\D;ςE-F:HG9GHIHW*HI*IJV*IW*IKU*LI!!M=*GNZV I\\H= IN\\H=*\\+OPF;;FFM=1OVGGJVGXGKUOQV~QOO#PRSP\"NOP؁NOPRTP\"RUP\"PVLP#PWXFO#FO9SFY=BO9VBOHZ>B9O#P[\\P!!B[\\P!!/PFW]P\"POT9SV^;O:#P1_1PPPRP\"9_`ab9c_d9_\\&`T`_9\\_p`VWe`P#P9`_9*9\"֚fPPPFF;F9ghPGiZ]j\"kF; FlF!RaPGN\\\\mV@@nPR֚RPTPPPG\\.\n~.\n" [edmacro-fix-menu-commands macro append current-minor-mode-maps current-local-map current-global-map maps (end-macro 48 49 50 51 52 53 54 55 56 57 45 21 -8388563 -8388560 -8388559 -8388558 -8388557 -8388556 -8388555 -8388554 -8388553 -8388552 -8388551) pkeys 13 mdigs edmacro-eight-bits 255 127 maxkey nil case-fold-search ("NUL" "TAB" "LFD" "RET" "ESC" "SPC" "DEL" "REM") res-words vconcat [end-macro] rest-mac "" res 0 len verbose 1 one-line i G40203 128 lsh 23 end-macro key-binding subseq (digit-argument negative-argument) "M-" " " 21 [21] universal-argument G40205 G40206 "C-u " [21] 45 (48 49 50 51 52 53 54 55 56 57) prefix apply max G40209 map b G40210 lookup-key bind-len key fkey tlen tkey G40211 t G40212 G40213 function-key-map G40214 G40215 G40216 bind first G40217 ch 32 92 char-to-string self-insert-command 2 text desc 30 string-match "^[ACHMsS]-." "^;;\\|^<.*>$\\|^\\\\[0-9]+$\\|^[0-9]+\\*." "^\\^.$" mapconcat format "%s * %d" execute-extended-command (return 13) commandp intern-soft "<<%s>>" #[(ch) "  \fT\nGWN\n\fH:N@  \"\"UF \"P A .\"S\"X=mՂ=xׂ=ق=ۂ=݂=ނXႲ\\\"U%X!\")P9\"\"" [ch "ACHMsS" G40229 -1 G40230 nil pf (18 22 20 23 19 21) G40231 bit "" G40232 logand lsh 1 0 format "%c-" 18 ch2 32 "NUL" 9 "TAB" 10 "LFD" 13 "RET" 27 "ESC" "SPC" "C-%c" 26 96 64 127 "DEL" maxkey char-to-string "\\%o" "<%s>" error "Unrecognized item in macro: %s"] 7] pos times mismatch :end1 :start2 :end2 "%d*%s" "\n" make-string 3 8 9 ";; " symbol-name 72 "\n "] 11] edmacro-fix-menu-commands #[(macro) " !I GWH H:A\fA@A@ƚ< #\f@\" T\"# TA\" T * " [vectorp macro 0 nil ev i (menu-bar) vconcat subseq vector menu-bar error "Macros with mouse clicks are not %s" "supported by this command"] 7] edmacro-parse-keys #[(string &optional need-vector) "\fGWA\f#AO\n \f\f\"D\fɕO!\n\fɕTO\f\f\"m!=YԂa!@a\fO# \f\"\fɔɕO\f۔ەOP\f\f\"\f!C \fޚ\f\"\f#\f!\"#\f\"!\fHA\"\\!\"\\\"\fO\f\f\"!\"\\!\"T\"\fO\f\f\"++A\f)\f\"]\f-/013/T/-GWV-/H03EN1_0\\\\13(1!\f-!Uk\f !\"U\f;\f\"\f9:;<:T:9GW9:H;!\\>$" vconcat key-binding [-8388488] execute-extended-command [-8388488] where-is-internal [-8388488] 2 -2 " " "^\\(\\([ACHMsS]-\\)*\\)<\\(.+\\)>$" 3 "\\<\\(NUL\\|RET\\|LFD\\|ESC\\|SPC\\|DEL\\)$" intern "REM" "^;;" "$" bits prefix orig-word "^[ACHMsS]-." lsh ((65 . 18) (67 . 22) (72 . 20) (77 . 23) (115 . 19) (83 . 21)) "^\\^.$" 22 assoc (("NUL" . "") ("RET" . " ") ("LFD" . "\n") ("TAB" . " ") ("ESC" . "") ("SPC" . " ") ("DEL" . "")) found "^\\\\[0-7]+$" G40236 -1 G40237 ch n t G40238 8 -48 vector 23 "^-?[0-9]+$" G40239 G40240 x G40241 error "%s must prefix a single character, not %s" logand "[@-_.a-z?]" "?" 127 31 G40242 4 24 40 41 subseq need-vector G40243 G40244 G40245 lognot ch2 G40246 G40247 G40248 128] 8]] 4) (defalias 'insert-kbd-macro #[(macroname &optional keys) " !Ę c ! \"c GV*c-c p\"cX \"W@ #cAD))" [nil definition symbol-name macroname "" format-kbd-macro "(setq last-kbd-macro" format "(defalias '%s" 50 " (read-kbd-macro\n" "\n (read-kbd-macro " prin1 "))\n" keys where-is-internal (keymap) "(global-set-key %S '%s)\n"] 5 "\ Insert in buffer the definition of kbd macro NAME, as Lisp code. Optional second arg KEYS means also record the keys it is on (this is the prefix argument, when calling interactively). This Lisp code will, when executed, define the kbd macro with the same definition it has now. If you say to record the keys, the Lisp code will also rebind those keys to the macro. Only global key bindings are recorded since executing this Lisp code always makes global bindings. To save a kbd macro, visit a file of Lisp code such as your `~/.emacs', use this command, and then save the file." "CInsert kbd macro (name): \nP"]) (provide (quote edmacro))