X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/db0406bb64f7e5dceeb257c7e350f1e80ed9c1c1..cd950da:/doc/emacs/kmacro.texi diff --git a/doc/emacs/kmacro.texi b/doc/emacs/kmacro.texi index c52381a663..a6344c049c 100644 --- a/doc/emacs/kmacro.texi +++ b/doc/emacs/kmacro.texi @@ -1,8 +1,8 @@ @c This is part of the Emacs manual. -@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2011 -@c Free Software Foundation, Inc. +@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2016 Free Software +@c Foundation, Inc. @c See file emacs.texi for copying conditions. -@node Keyboard Macros, Files, Fixit, Top +@node Keyboard Macros @chapter Keyboard Macros @cindex defining keyboard macros @cindex keyboard macro @@ -35,8 +35,10 @@ intelligent or general. For such things, Lisp must be used. * Basic Keyboard Macro:: Defining and running keyboard macros. * Keyboard Macro Ring:: Where previous keyboard macros are saved. * Keyboard Macro Counter:: Inserting incrementing numbers in macros. -* Keyboard Macro Query:: Making keyboard macros do different things each time. -* Save Keyboard Macro:: Giving keyboard macros names; saving them in files. +* Keyboard Macro Query:: Making keyboard macros do different things each + time. +* Save Keyboard Macro:: Giving keyboard macros names; saving them in + files. * Edit Keyboard Macro:: Editing keyboard macros. * Keyboard Macro Step-Edit:: Interactively executing and editing a keyboard macro. @@ -147,7 +149,7 @@ beginning of the line and then executing the macro. @findex kmacro-start-macro @findex kmacro-end-macro In addition to the @key{F3} and @key{F4} commands described above, -Emacs also supports an older set of keybindings for defining and +Emacs also supports an older set of key bindings for defining and executing keyboard macros. To begin a macro definition, type @kbd{C-x (} (@code{kmacro-start-macro}); as with @key{F3}, a prefix argument appends this definition to the last keyboard macro. To end a macro @@ -192,9 +194,9 @@ C-x C-k C-p C-p C-k C-k C-k C-n C-n C-k C-p C-k C-d @end example @noindent -will rotate the keyboard macro ring to the ``second previous'' macro, +will rotate the keyboard macro ring to the second-previous macro, execute the resulting head macro three times, rotate back to the -original head macro, execute that once, rotate to the ``previous'' +original head macro, execute that once, rotate to the previous macro, execute that, and finally delete it from the macro ring. @findex kmacro-end-or-call-macro-repeat @@ -222,8 +224,8 @@ immediately by repeating just @kbd{C-n} and @kbd{C-p} until the desired macro is at the head of the ring. To execute the new macro ring head immediately, just type @kbd{C-k}. - Note that Emacs treats the head of the macro ring as the ``last -defined keyboard macro.'' For instance, @key{F4} will execute that + Note that Emacs treats the head of the macro ring as the last +defined keyboard macro. For instance, @key{F4} will execute that macro, and @kbd{C-x C-k n} will give it a name. @vindex kmacro-ring-max @@ -332,8 +334,8 @@ numbers stored in registers. If you use a register as a counter, incrementing it on each repetition of the macro, that accomplishes the same thing as a -keyboard macro counter. @xref{RegNumbers}. For most purposes, it is -simpler to use a keyboard macro counter. +keyboard macro counter. @xref{Number Registers}. For most purposes, +it is simpler to use a keyboard macro counter. @node Keyboard Macro Query @section Executing Macros with Variations @@ -480,10 +482,11 @@ Edit the last 300 keystrokes as a keyboard macro @kindex C-x C-k C-e @kindex C-x C-k RET You can edit the last keyboard macro by typing @kbd{C-x C-k C-e} or -@kbd{C-x C-k RET} (@code{kmacro-edit-macro}). This formats the macro -definition in a buffer and enters a specialized major mode for editing -it. Type @kbd{C-h m} once in that buffer to display details of how to -edit the macro. When you are finished editing, type @kbd{C-c C-c}. +@kbd{C-x C-k @key{RET}} (@code{kmacro-edit-macro}). This formats the +macro definition in a buffer and enters a specialized major mode for +editing it. Type @kbd{C-h m} once in that buffer to display details +of how to edit the macro. When you are finished editing, type +@kbd{C-c C-c}. @findex edit-kbd-macro @kindex C-x C-k e @@ -503,7 +506,7 @@ keyboard input that you would use to invoke the macro---@kbd{C-x e} or @findex kmacro-step-edit-macro @kindex C-x C-k SPC You can interactively replay and edit the last keyboard -macro, one command at a time, by typing @kbd{C-x C-k SPC} +macro, one command at a time, by typing @kbd{C-x C-k @key{SPC}} (@code{kmacro-step-edit-macro}). Unless you quit the macro using @kbd{q} or @kbd{C-g}, the edited macro replaces the last macro on the macro ring. @@ -515,15 +518,15 @@ options. These actions are available: @itemize @bullet{} @item -@kbd{SPC} and @kbd{y} execute the current command, and advance to the +@key{SPC} and @kbd{y} execute the current command, and advance to the next command in the keyboard macro. @item -@kbd{n}, @kbd{d}, and @kbd{DEL} skip and delete the current command. +@kbd{n}, @kbd{d}, and @key{DEL} skip and delete the current command. @item @kbd{f} skips the current command in this execution of the keyboard macro, but doesn't delete it from the macro. @item -@kbd{@key{TAB}} executes the current command, as well as all similar +@key{TAB} executes the current command, as well as all similar commands immediately following the current command; for example, @key{TAB} may be used to insert a sequence of characters (corresponding to a sequence of @code{self-insert-command} commands). @@ -539,31 +542,31 @@ with the edited macro. @kbd{q} and @kbd{C-g} cancels the step-editing of the keyboard macro; discarding any changes made to the keyboard macro. @item -@kbd{i KEY... C-j} reads and executes a series of key sequences (not +@kbd{i @var{key}@dots{} C-j} reads and executes a series of key sequences (not including the final @kbd{C-j}), and inserts them before the current command in the keyboard macro, without advancing over the current command. @item -@kbd{I KEY...} reads one key sequence, executes it, and inserts it +@kbd{I @var{key}@dots{}} reads one key sequence, executes it, and inserts it before the current command in the keyboard macro, without advancing over the current command. @item -@kbd{r KEY... C-j} reads and executes a series of key sequences (not +@kbd{r @var{key}@dots{} C-j} reads and executes a series of key sequences (not including the final @kbd{C-j}), and replaces the current command in the keyboard macro with them, advancing over the inserted key sequences. @item -@kbd{R KEY...} reads one key sequence, executes it, and replaces the +@kbd{R @var{key}@dots{}} reads one key sequence, executes it, and replaces the current command in the keyboard macro with that key sequence, advancing over the inserted key sequence. @item -@kbd{a KEY... C-j} executes the current command, then reads and +@kbd{a @var{key}@dots{} C-j} executes the current command, then reads and executes a series of key sequences (not including the final @kbd{C-j}), and inserts them after the current command in the keyboard macro; it then advances over the current command and the inserted key sequences. @item -@kbd{A KEY... C-j} executes the rest of the commands in the keyboard +@kbd{A @var{key}@dots{} C-j} executes the rest of the commands in the keyboard macro, then reads and executes a series of key sequences (not including the final @kbd{C-j}), and appends them at the end of the keyboard macro; it then terminates the step-editing and replaces the