aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2021-11-06 05:37:08 +0100
committerStefan Kangas2021-11-06 05:41:05 +0100
commit4e7e78d5782cdc3f66d3e98507c9b71556a8a2b1 (patch)
treed35012e404f2cf3e8b8a8acf8530a0b88b248709
parentd8c9a9dc23e0c6f38c5138cb8fbb4109a5729a35 (diff)
downloademacs-4e7e78d5782cdc3f66d3e98507c9b71556a8a2b1.tar.gz
emacs-4e7e78d5782cdc3f66d3e98507c9b71556a8a2b1.zip
Improve docstring of kmacro-set-format
* lisp/kmacro.el (kmacro-set-format): Improve docstring. (kmacro-insert-counter, kmacro-display-counter) (kmacro-set-counter, kmacro-add-counter): Add cross-references to the info manual.
-rw-r--r--lisp/kmacro.el40
1 files changed, 35 insertions, 5 deletions
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index bb41a962c3a..3f492a851ea 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -260,8 +260,12 @@ Can be set directly via `kmacro-set-format', which see.")
260Interactively, ARG defaults to 1. With \\[universal-argument], insert 260Interactively, ARG defaults to 1. With \\[universal-argument], insert
261the previous value of `kmacro-counter', and do not increment the 261the previous value of `kmacro-counter', and do not increment the
262current value. 262current value.
263
263The previous value of the counter is the one it had before 264The previous value of the counter is the one it had before
264the last increment." 265the last increment.
266
267See Info node `(emacs) Keyboard Macro Counter' for more
268information."
265 (interactive "P") 269 (interactive "P")
266 (if kmacro-initial-counter-value 270 (if kmacro-initial-counter-value
267 (setq kmacro-counter kmacro-initial-counter-value 271 (setq kmacro-counter kmacro-initial-counter-value
@@ -273,7 +277,24 @@ the last increment."
273 277
274 278
275(defun kmacro-set-format (format) 279(defun kmacro-set-format (format)
276 "Set the format of `kmacro-counter' to FORMAT." 280 "Set the format of `kmacro-counter' to FORMAT.
281
282The default format is \"%d\", which means to insert the number in
283decimal without any padding. You can specify any format string
284that the `format' function accepts and that makes sense with a
285single integer extra argument.
286
287If you run this command while no keyboard macro is being defined,
288the new format affects all subsequent macro definitions.
289
290If you run this command while defining a keyboard macro, it
291affects only that macro, from that point on.
292
293Do not put the format string inside double quotes when you insert
294it in the minibuffer.
295
296See Info node `(emacs) Keyboard Macro Counter' for more
297information."
277 (interactive "sMacro Counter Format: ") 298 (interactive "sMacro Counter Format: ")
278 (setq kmacro-counter-format 299 (setq kmacro-counter-format
279 (if (equal format "") "%d" format)) 300 (if (equal format "") "%d" format))
@@ -283,7 +304,10 @@ the last increment."
283 304
284 305
285(defun kmacro-display-counter (&optional value) 306(defun kmacro-display-counter (&optional value)
286 "Display current counter value." 307 "Display current counter value.
308
309See Info node `(emacs) Keyboard Macro Counter' for more
310information."
287 (unless value (setq value kmacro-counter)) 311 (unless value (setq value kmacro-counter))
288 (message "New macro counter value: %s (%d)" 312 (message "New macro counter value: %s (%d)"
289 (format kmacro-counter-format value) value)) 313 (format kmacro-counter-format value) value))
@@ -291,7 +315,10 @@ the last increment."
291(defun kmacro-set-counter (arg) 315(defun kmacro-set-counter (arg)
292 "Set the value of `kmacro-counter' to ARG, or prompt for value if no argument. 316 "Set the value of `kmacro-counter' to ARG, or prompt for value if no argument.
293With \\[universal-argument] prefix, reset counter to its value prior to this iteration of the 317With \\[universal-argument] prefix, reset counter to its value prior to this iteration of the
294macro." 318macro.
319
320See Info node `(emacs) Keyboard Macro Counter' for more
321information."
295 (interactive "NMacro counter value: ") 322 (interactive "NMacro counter value: ")
296 (if (not (or defining-kbd-macro executing-kbd-macro)) 323 (if (not (or defining-kbd-macro executing-kbd-macro))
297 (kmacro-display-counter (setq kmacro-initial-counter-value arg)) 324 (kmacro-display-counter (setq kmacro-initial-counter-value arg))
@@ -305,7 +332,10 @@ macro."
305 332
306(defun kmacro-add-counter (arg) 333(defun kmacro-add-counter (arg)
307 "Add the value of numeric prefix arg (prompt if missing) to `kmacro-counter'. 334 "Add the value of numeric prefix arg (prompt if missing) to `kmacro-counter'.
308With \\[universal-argument], restore previous counter value." 335With \\[universal-argument], restore previous counter value.
336
337See Info node `(emacs) Keyboard Macro Counter' for more
338information."
309 (interactive "NAdd to macro counter: ") 339 (interactive "NAdd to macro counter: ")
310 (if kmacro-initial-counter-value 340 (if kmacro-initial-counter-value
311 (setq kmacro-counter kmacro-initial-counter-value 341 (setq kmacro-counter kmacro-initial-counter-value