comparison man/custom.texi @ 38791:a670b4af3cb4

Show a keyboard macro with minibuffer arguments in it.
author Richard M. Stallman <rms@gnu.org>
date Sun, 12 Aug 2001 21:22:26 +0000
parents 3e5c99acf21a
children d44abb4e68b2
comparison
equal deleted inserted replaced
38790:dc7cb360c349 38791:a670b4af3cb4
1114 to the next place you want to use it. For example, if you want to change 1114 to the next place you want to use it. For example, if you want to change
1115 each line, you should position point at the start of a line, and define a 1115 each line, you should position point at the start of a line, and define a
1116 macro to change that line and leave point at the start of the next line. 1116 macro to change that line and leave point at the start of the next line.
1117 Then repeating the macro will operate on successive lines. 1117 Then repeating the macro will operate on successive lines.
1118 1118
1119 After you have terminated the definition of a keyboard macro, you can add 1119 When a command reads an argument with the minibuffer, your
1120 to the end of its definition by typing @kbd{C-u C-x (}. This is equivalent 1120 minibuffer input becomes part of the macro along with the command. So
1121 to plain @kbd{C-x (} followed by retyping the whole definition so far. As 1121 when you replay the macro, the command gets the same argument as
1122 a consequence it re-executes the macro as previously defined. 1122 when you entered the macro. For example,
1123
1124 @example
1125 C-x ( C-a C-@key{SPC} C-n M-w C-x b f o o @key{RET} C-y C-x b @key{RET} C-x )
1126 @end example
1127
1128 @noindent
1129 defines a macro that copies the current line into the buffer
1130 @samp{foo}, then returns to the original buffer.
1123 1131
1124 You can use function keys in a keyboard macro, just like keyboard 1132 You can use function keys in a keyboard macro, just like keyboard
1125 keys. You can even use mouse events, but be careful about that: when 1133 keys. You can even use mouse events, but be careful about that: when
1126 the macro replays the mouse event, it uses the original mouse position 1134 the macro replays the mouse event, it uses the original mouse position
1127 of that event, the position that the mouse had while you were defining 1135 of that event, the position that the mouse had while you were defining
1132 command @kbd{C-M-c} (@code{exit-recursive-edit}). When this command 1140 command @kbd{C-M-c} (@code{exit-recursive-edit}). When this command
1133 exits a recursive edit that started within the macro, it works as you'd 1141 exits a recursive edit that started within the macro, it works as you'd
1134 expect. But if it exits a recursive edit that started before you 1142 expect. But if it exits a recursive edit that started before you
1135 invoked the keyboard macro, it also necessarily exits the keyboard macro 1143 invoked the keyboard macro, it also necessarily exits the keyboard macro
1136 as part of the process. 1144 as part of the process.
1145
1146 After you have terminated the definition of a keyboard macro, you can add
1147 to the end of its definition by typing @kbd{C-u C-x (}. This is equivalent
1148 to plain @kbd{C-x (} followed by retyping the whole definition so far. As
1149 a consequence it re-executes the macro as previously defined.
1137 1150
1138 @findex edit-kbd-macro 1151 @findex edit-kbd-macro
1139 @kindex C-x C-k 1152 @kindex C-x C-k
1140 You can edit a keyboard macro already defined by typing @kbd{C-x C-k} 1153 You can edit a keyboard macro already defined by typing @kbd{C-x C-k}
1141 (@code{edit-kbd-macro}). Follow that with the keyboard input that you 1154 (@code{edit-kbd-macro}). Follow that with the keyboard input that you