;;; compiled by rms@mole.gnu.ai.mit.edu on Wed May 12 23:27:41 1993
;;; from file /home/fsf/rms/e19/lisp/macros.el
;;; emacs version 19.5.10.
;;; bytecomp version FSF 2.08
;;; optimization is on.

(defalias 'name-last-kbd-macro #[(symbol) " !! K; \"M" [last-kbd-macro error "No keyboard macro defined" fboundp symbol "Function %s is already defined and not a keyboard macro."] 3 "\
Assign a name to the last keyboard macro defined.
Argument SYMBOL is the name to define.
The symbol's function definition becomes the keyboard macro string.
Such a \"function\" cannot be called from Lisp, but it is a valid editor command." "SName for last kbd macro: "])
(defalias 'insert-kbd-macro #[(macroname &optional keys) "!\" c Kcp\"c`	p\" b`W gWX ``T\"\\\" Wf ! Uy ``T\"c W ``T\"Z\" W ``T\"Z\" U ``T\"c)7 *c \" c@p\"cp\"cA ))" [nil definition string= symbol-name macroname "" last-kbd-macro "(setq " "(fset '" prin1 "\n   " end beg point-marker char 32 delete-region insert "\\C-" 96 127 forward-char 1 "\\C-?" 160 "\\M-C-" 255 "\\M-" 128 "\\M-C-?" ")\n" keys where-is-internal "(global-set-key " " '"] 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"])
(defalias 'kbd-macro-query #[(flag) " 	 ! ŉ *?? !\n ŉ\n! *!\"=V  =e  =t  = ! = ŉ * =  =  ݐ!!*& *" [executing-macro defining-kbd-macro error "Not defining or executing kbd macro" flag nil recursive-edit t substitute-command-keys "Proceed with macro?\\<query-replace-map> (\\[act], \\[skip], \\[exit], \\[recenter], \\[edit]) " msg loop message read-event def key vector lookup-key query-replace-map act skip "" exit recenter edit quit quit-flag help ding "*Help*" princ "Specify how to procede with keyboard macro execution.\nPossibilities: \\<query-replace-map>\n\\[act]	Finish this iteration normally and continue with the next.\n\\[skip]	Skip the rest of this iteration, and start the next.\n\\[exit]	Stop the macro entirely right now.\n\\[recenter]	Redisplay the screen, then ask again.\n\\[edit]	Enter recursive edit; ask again when you exit from that."] 5 "\
Query user during kbd macro execution.
  With prefix argument, enters recursive edit, reading keyboard
commands even within a kbd macro.  You can give different commands
each time the macro executes.
  Without prefix argument, asks whether to continue running the macro.
Your options are: \\<query-replace-map>
\\[act]	Finish this iteration normally and continue with the next.
\\[skip]	Skip the rest of this iteration, and start the next.
\\[exit]	Stop the macro entirely right now.
\\[recenter]	Redisplay the screen, then ask again.
\\[edit]	Enter recursive edit; ask again when you exit from that." "P"])
(defalias 'apply-macro-to-region-lines #[(top bottom &optional macro) " 	 !	b! 	\nbn) ! 		\nWR 	b!	`\")L 	!)- \n\"	\"+" [macro last-kbd-macro error "No keyboard macro has been defined." bottom forward-line 0 point-marker nil next-line-marker end-marker top 1 set-marker execute-kbd-macro] 3 "\
For each complete line between point and mark, move to the beginning
of the line, and run the last keyboard macro.

When called from lisp, this function takes two arguments TOP and
BOTTOM, describing the current region.  TOP must be before BOTTOM.
The optional third argument MACRO specifies a keyboard macro to
execute.

This is useful for quoting or unquoting included text, adding and
removing comments, or producing tables where the entries are regular.

For example, in Usenet articles, sections of text quoted from another
author are indented, or have each line start with `>'.  To quote a
section of text, define a keyboard macro which inserts `>', put point
and mark at opposite ends of the quoted section, and use
`\\[apply-macro-to-region-lines]' to mark the entire section.

Suppose you wanted to build a keyword table in C where each entry
looked like this:

    { \"foo\", foo_data, foo_function }, 
    { \"bar\", bar_data, bar_function },
    { \"baz\", baz_data, baz_function },

You could enter the names in this format:

    foo
    bar
    baz

and write a macro to massage a word into a table entry:

    \\C-x (
       \\M-d { \"\\C-y\", \\C-y_data, \\C-y_function },
    \\C-x )

and then select the region of un-tablified names and use
`\\[apply-macro-to-region-lines]' to build the table from the names.
" "r"])
(define-key ctl-x-map "q" (quote kbd-macro-query))
