Function: kmacro-set-format

kmacro-set-format is an interactive and byte-compiled function defined in kmacro.el.gz.

Signature

(kmacro-set-format FORMAT)

Documentation

Set the format of kmacro-counter to FORMAT.

The default format is "%d", which means to insert the number in decimal without any padding. You can specify any format string that the format function accepts and that makes sense with a single integer extra argument.

If you run this command while no keyboard macro is being defined, the new format affects all subsequent macro definitions.

If you run this command while defining a keyboard macro, it affects only that macro, from that point on.

Do not put the format string inside double quotes when you insert it in the minibuffer.

See Info node (emacs) Keyboard Macro Counter for more information.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/kmacro.el.gz
(defun kmacro-set-format (format)
  "Set the format of `kmacro-counter' to FORMAT.

The default format is \"%d\", which means to insert the number in
decimal without any padding.  You can specify any format string
that the `format' function accepts and that makes sense with a
single integer extra argument.

If you run this command while no keyboard macro is being defined,
the new format affects all subsequent macro definitions.

If you run this command while defining a keyboard macro, it
affects only that macro, from that point on.

Do not put the format string inside double quotes when you insert
it in the minibuffer.

See Info node `(emacs) Keyboard Macro Counter' for more
information."
  (interactive "sMacro Counter Format: ")
  (setq kmacro-counter-format
	(if (equal format "") "%d" format))
  ;; redefine initial macro counter if we are not executing a macro.
  (if (not (or defining-kbd-macro executing-kbd-macro))
      (setq kmacro-default-counter-format kmacro-counter-format)))