;ELC ;;; Compiled by cyd@localhost on Mon Apr 23 22:20:57 2007 ;;; from file /home/cyd/emacs/lisp/macros.el ;;; in Emacs version 22.0.99 ;;; 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 "`macros.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #@238 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. (defalias 'name-last-kbd-macro #[(symbol) "\204\302\303!\210\304 !\203 K;\204 \305 K!\204 \302\306 \"\210 \307\230\203*\302\310!\210 M\207" [last-kbd-macro symbol error "No keyboard macro defined" fboundp vectorp "Function %s is already defined and not a keyboard macro" "" "No command name given"] 3 (#$ . 560) "SName for last kbd macro: "]) #@584 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. (defalias 'insert-kbd-macro #[(macroname &optional keys) "\306\307 !\310\230\203\302\n\311c\210\202 K\312c\210\313 p\"\210\314c\210;\2033`\306\313p\"\210\315 \fb\210` W\203/g\211\316U\203O``T|\210\317c\210\202+ \320W\203d``T|\210\321 \322\\\261\210\202+ \323U\203u``T|\210\324c\210\202+ \325W\203\212``T|\210\321 \326\\\261\210\202+ \327W\203\226\330u\210\202+ \327U\203\247``T|\210\331c\210\202+ \332U\203\270``T|\210\333c\210\202+ \334\316HU\203\313``T|\210\335c\210\202+ \336W\203\340``T|\210\337 \325Z\261\210\202+ \340W\203\365``T|\210\337 \326Z\261\210\202+ \341\316HU\203``T|\210\342c\210\202+ \343W\203``T|\210\344 \332Z\261\210\202+ \343U\203+``T|\210\345c\210)\2026*\202N\346!\203IG\316\306\211@ABABW\203@\347A!\203X\350\202Y\325c\210AHATA \247\204r\313 p\"\210\202E\351c\210\352 !@\353 !@\203\367@@\354=\203\221\321c\210\202\356@@\355=\203\237\344c\210\202\356@@\356=\203\255\357c\210\202\356@@\360=\203\273\361c\210\202\356@@\362=\203\311\363c\210\202\356@@\364=\203\343 \365Y\203\343 \366X\203\343 \226\202\356@@\364=\203\356\367c\210@A\211@\204\203 \370U\203\371c\210\202E \372U\203\373c\210\202E \374U\203\375c\210\202E \327U\203'\331c\210\202E \327W\2033 c\210\202E\376\377\201D \"\261\210\202E\201Ec\210,\202N\313p\"\210\201Fc\210C\205\214\201G \201H\"\211C\205\213\201Ic\210\313C@p\"\210\201Jc\210\313 p\"\210\201Fc\210CA\211C\204f\306))\207" [definition macroname last-kbd-macro end beg char nil symbol-name "" "(setq " "(fset '" prin1 "\n " point-marker 0 "\\C-@" 27 "\\C-" 96 28 "\\C-\\\\" 32 64 127 1 "\\C-?" 128 "\\M-\\C-@" "\234" "\\M-\\C-\\\\" 155 "\\M-\\C-" 160 "\334" "\\M-\\\\" 255 "\\M-" "\\M-\\C-?" vectorp zerop 91 "?" event-modifiers event-basic-type control meta hyper "\\H-" super "\\s-" alt "\\A-" shift 97 122 "\\S-" 92 "\\\\" 34 "\\\"" 59 "\\;" "\\" format mods i len keys "%o" 93 ")\n" where-is-internal (keymap) "(global-set-key " " '"] 5 (#$ . 1156) (list (intern (completing-read "Insert kbd macro (name): " obarray (lambda (elt) (and (fboundp elt) (or (stringp (symbol-function elt)) (vectorp (symbol-function elt)) (get elt 'kmacro)))) t)) current-prefix-arg)]) #@596 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: \ \[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. (defalias 'kbd-macro-query #[(flag) "\204\f \204\f\306\307!\210\n\203\310\211\311 *\207\205\262\312\313\314!\f\205\261\310\211\315\316 \"\210\317 *\310\320!\321 \"\211\322=\203N\310\202\255 \323=\203[\310\324\202\255 \325=\203h\310\312\202\255 \326=\203u\326\310!\210\202\255 \327=\203\206\310\211\311 \210*\202\255 \330=\203\222\312!\202\255 \331=\204\233\332 \210\333\220\334\313\335!!\210\212\"q\210\336 )\221\210*\202\"*\207" [executing-kbd-macro defining-kbd-macro flag msg loop def error "Not defining or executing kbd macro" nil recursive-edit t substitute-command-keys "Proceed with macro?\\ (\\[act], \\[skip], \\[exit], \\[recenter], \\[edit]) " message "%s" read-event vector lookup-key act skip "" exit recenter edit quit help ding "*Help*" princ "Specify how to proceed with keyboard macro execution.\nPossibilities: \\\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." help-mode key query-replace-map quit-flag standard-output] 5 (#$ . 3986) "P"]) #@1360 Apply last keyboard macro to all lines in the region. For each line that begins in the region, 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. (defalias 'apply-macro-to-region-lines #[(top bottom &optional macro) "\204 \204\f\306\307!\210 \212\310\n!\311 b\210n\204\312y\210\313  \fW\203E b\210\212\312y\210 `\311\223\210)\212\311 \314\206? !\210*\202\"\f\311\211\223\210 \311\211\223+\207" [macro last-kbd-macro bottom next-line-marker end-marker top error "No keyboard macro has been defined" copy-marker nil 1 point-marker execute-kbd-macro mark-active] 3 (#$ . 5883) "r"]) (provide 'macros)