Function: kmacro-insert-counter
kmacro-insert-counter is an interactive and byte-compiled function
defined in kmacro.el.gz.
Signature
(kmacro-insert-counter ARG)
Documentation
Insert current value of kmacro-counter, then increment it by ARG.
Interactively, ARG defaults to 1. With C-u (universal-argument), insert
the previous value of kmacro-counter, and do not increment the
current value.
The previous value of the counter is the one it had before the last increment.
See Info node (emacs) Keyboard Macro Counter for more information.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/kmacro.el.gz
(defun kmacro-insert-counter (arg)
"Insert current value of `kmacro-counter', then increment it by ARG.
Interactively, ARG defaults to 1. With \\[universal-argument], insert
the previous value of `kmacro-counter', and do not increment the
current value.
The previous value of the counter is the one it had before
the last increment.
See Info node `(emacs) Keyboard Macro Counter' for more
information."
(interactive "P")
(if kmacro-initial-counter-value
(setq kmacro-counter kmacro-initial-counter-value
kmacro-initial-counter-value nil))
(if (consp arg)
(insert (format kmacro-counter-format kmacro-last-counter))
(insert (format kmacro-counter-format kmacro-counter))
(kmacro-add-counter (prefix-numeric-value arg))))