reset kmacro-initial-counter-value if set.
(kmacro-set-counter): Only set kmacro-counter if defining or executing
macro. Set kmacro-initial-counter-value otherwise. Never set both.
(kmacro-display): Show macro counter if non-zero.
counter and format with binding.
(kmacro-name-last-macro): New defun. Like name-last-kbd-macro, but
the declared macro uses own macro counter and format. Give symbol
kmacro property.
(kmacro-keymap): Bind kmacro-name-last-macro to n.
(kmacro-start-macro, kmacro-end-macro, kmacro-call-macro)
(kmacro-end-and-call-macro): Doc fix.
initialization for clarity. Bind C-s to start macro.
Remove C-r binding.
(kmacro-initial-counter-value): New defvar to hold initial counter
value in case we set the value before defining a macro.
(kmacro-insert-counter): Clear kmacro-initial-counter-value..
(kmacro-set-counter): Set kmacro-initial-counter-value if we are
not defining or executing macro. Doc fix.
(kmacro-add-counter): Clear kmacro-initial-counter-value.
(kmacro-view-last-item, kmacro-view-item-no): New defvars used to
temporarily view older elements on the macro ring without cycling
the ring.
(kmacro-display): Doc fix.
(kmacro-exec-ring-item): New helper function.
(kmacro-call-ring-2nd): Use it.
(kmacro-call-ring-2nd-repeat): Doc fix.
(kmacro-start-macro): Use (and clear) kmacro-initial-counter-value.
(kmacro-end-or-call-macro): Execute last viewed macro (using
kmacro-exec-ring-item) from ring if this follows
kmacro-view-macro. This allows us to find a macro on the ring
with C-x C-k C-v C-v ... and execute it (with C-k) without cycling
the ring to bring it to the head of the ring.
(kmacro-bind-to-key): Doc fix (describe reserved bindings).
Allow binding to reserved keys without specifying C-x C-k prefix.
Ask for confirmation if entered key sequence is already bound to
a non-macro command.
(kmacro-view-macro): Repeating command will show older elements
on the macro ring; C-k will execute the last viewed macro.
(kmacro-view-macro-repeat): Doc fix. Change its kmacro-repeat
property from 'ring to 'head.
(kmacro-step-edit-map): Bind "A" to `append-end'.
(kmacro-step-edit-prompt): Fix prompt.
(kmacro-step-edit-query): Handle `append-end' response.
(kmacro-step-edit-pre-command): Activate `append-end' at end of
macro when required.
call keyboard macro in one step. Bind it to C-x e by default.
(kmacro-call-macro): Use format-kbd-macro.
(kmacro-step-edit-macro): New command to interactively step edit
and execute last keyboard macro.
(kmacro-keymap): Bind SPC [C-x C-k SPC] to kmacro-step-edit-macro.
(kmacro-step-edit-mini-window-height): New custom var.
(kmacro-step-edit-map): New keymap (parent is query-replace-map).
(kmacro-step-edit-prefix-commands): New var.
(kmacro-step-edit-prompt, kmacro-step-edit-query)
(kmacro-step-edit-insert, kmacro-step-edit-pre-command)
(kmacro-step-edit-minibuf-setup, kmacro-step-edit-post-command):
New aux functions for step editing keyboard macros.
Changed default binding of C-x e to kmacro-end-or-call-macro.
(kmacro-call-repeat-key, kmacro-call-repeat-with-arg): New custom
variables.
(kmacro-get-prefix-arg): New function.
(kmacro-repeat-on-last-key): Renamed from kmacro-repeat-loop and improved.
Callers changed.
(kmacro-call-macro): Repeat macro by repeating last key or
key defined in kmacro-call-repeat-key. New third arg non-nil
means to end current macro.
(kmacro-end-or-call-macro): Call kmacro-call-macro appropriately
to get repeat last key functionality.
(kmacro-start-macro-or-insert-counter): Improve doc string.
Most important change is that C-x C-k is now bound to a keymap
with keyboard macro related commands. The original binding on
C-x C-k is moved to C-x C-k e.