1 2/22/79  -- Macro edit mode.
  2 
  3 **This file is intended to be perused via dprint, print, or via an**
  4 **editor.  It is not intended to be perused with the help command **
  5 
  6 
  7 
  8 
  9 ^L
 10 
 11 This package allows you to
 12    1) Get printed representations of all keyboard macros defined
 13       in an environment into a buffer for
 14          a) Editing them.
 15          b) Re-defining them from the edited version
 16          c) Writing them out to a file, for later
 17               I) Dprintng
 18               II) Getting those macros automatically defined in a later
 19                   invocation of Emacs.
 20 
 21 1. Getting printed representations of all your macros into a buffer.
 22 
 23    Make sure all your macros are hooked up to keys, or at least were at
 24    some time given names, then,
 25 
 26      ESC-x edit-macros  CR
 27 
 28    will put you in a buffer in "Macro Edit" mode with all the macros
 29    defined in that buffer in editable form.
 30 
 31   a. Editing them.
 32 
 33 In Macro Edit mode, the following functions exist, on these keys:
 34 
 35 esc-^A    macedit-find-beginning-of-macdef
 36 
 37           Move to the beginning of the current macro defintion.
 38 
 39 esc-^B    macedit-backward-term
 40 
 41           Move backward one term in the keyboard macro.
 42 
 43 esc-^C    macedit-compile-to-lisp
 44 
 45           Still under development, works a little bit, but impressive
 46           even for the little bit it works.  Compiles the macro being
 47           pointed at into lisp.
 48 
 49 esc-^E    macedit-find-end-of-macdef
 50 
 51           Move to the end of the current macro definition.
 52 
 53 esc-^F    macedit-forward-term
 54 
 55           Move forward one term in the current macro definition.
 56 
 57 esc-^H    macedit-mark-whole-macro
 58 
 59           Put point and mark around the macro definition.
 60 
 61 esc-^K    macedit-kill-term
 62 
 63           Kill forward to the end of the current (or next) term in
 64           the current macro definition.
 65 
 66 esc-^N    macedit-forward-macdef
 67 
 68           Move forward to the beginning of the next macro definition.
 69 
 70 esc-^P    macedit-backward-macdef
 71 
 72           Move backward to the beginning of the previous macro definition.
 73 
 74 esc-^S    macedit-state-keyboard-macro
 75 
 76           Prompt for a key; place the definition of the keyboard macro on
 77           that key into the buffer at the current point.
 78 
 79 b) Redefining them from the edited version:
 80 
 81 esc-^Z    macedit-take-up-definition
 82 
 83           Take up into the editor, as a live definition, the current macro
 84           definition being pointed at.  Use this after editing a macro
 85           definition to redefine it thusly.
 86 
 87 
 88 ESC-X load-these-macros
 89 
 90           Accept all the macro definitions in the buffer, redefine them
 91           all.
 92 
 93 c) Writing them out.
 94 
 95    Use ^x^w as normal, any file you want, but if it has the suffix
 96    ".emacro", it will be automatically find-filed'd into Macro Edit
 97    mode when it is next find-file'd.
 98 
 99 Macro language has PL/I like comments (/* comment... */). ESC-;,
100 ESC-P, and ESC-N do the right thing. The comment column is 51.
101 Quoted strings are double-quoted.  Macro definitions look like
102 
103    macro foo-the-bar on ^q
104      ^S "bar" ESC ESC-# "foo"
105    end-macro foo-the-bar
106 
107 The "on ^q" is optional.  If present, it will cause a set-perm-key
108 to that macro.
109 
110 The command
111 
112    ESC-X load-macrofile  PATHNAME CR
113 
114 may be issued at any time to take up one of these macro files and define
115 all the keyboard macros in it.