diff options
| author | Stefan Kangas | 2021-11-06 05:37:08 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2021-11-06 05:41:05 +0100 |
| commit | 4e7e78d5782cdc3f66d3e98507c9b71556a8a2b1 (patch) | |
| tree | d35012e404f2cf3e8b8a8acf8530a0b88b248709 | |
| parent | d8c9a9dc23e0c6f38c5138cb8fbb4109a5729a35 (diff) | |
| download | emacs-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.el | 40 |
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.") | |||
| 260 | Interactively, ARG defaults to 1. With \\[universal-argument], insert | 260 | Interactively, ARG defaults to 1. With \\[universal-argument], insert |
| 261 | the previous value of `kmacro-counter', and do not increment the | 261 | the previous value of `kmacro-counter', and do not increment the |
| 262 | current value. | 262 | current value. |
| 263 | |||
| 263 | The previous value of the counter is the one it had before | 264 | The previous value of the counter is the one it had before |
| 264 | the last increment." | 265 | the last increment. |
| 266 | |||
| 267 | See Info node `(emacs) Keyboard Macro Counter' for more | ||
| 268 | information." | ||
| 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 | |||
| 282 | The default format is \"%d\", which means to insert the number in | ||
| 283 | decimal without any padding. You can specify any format string | ||
| 284 | that the `format' function accepts and that makes sense with a | ||
| 285 | single integer extra argument. | ||
| 286 | |||
| 287 | If you run this command while no keyboard macro is being defined, | ||
| 288 | the new format affects all subsequent macro definitions. | ||
| 289 | |||
| 290 | If you run this command while defining a keyboard macro, it | ||
| 291 | affects only that macro, from that point on. | ||
| 292 | |||
| 293 | Do not put the format string inside double quotes when you insert | ||
| 294 | it in the minibuffer. | ||
| 295 | |||
| 296 | See Info node `(emacs) Keyboard Macro Counter' for more | ||
| 297 | information." | ||
| 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 | |||
| 309 | See Info node `(emacs) Keyboard Macro Counter' for more | ||
| 310 | information." | ||
| 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. |
| 293 | With \\[universal-argument] prefix, reset counter to its value prior to this iteration of the | 317 | With \\[universal-argument] prefix, reset counter to its value prior to this iteration of the |
| 294 | macro." | 318 | macro. |
| 319 | |||
| 320 | See Info node `(emacs) Keyboard Macro Counter' for more | ||
| 321 | information." | ||
| 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'. |
| 308 | With \\[universal-argument], restore previous counter value." | 335 | With \\[universal-argument], restore previous counter value. |
| 336 | |||
| 337 | See Info node `(emacs) Keyboard Macro Counter' for more | ||
| 338 | information." | ||
| 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 |