aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris2018-05-15 09:09:48 -0700
committerGlenn Morris2018-05-15 09:09:48 -0700
commit3ee1841f288b5b9cf9301945d10db2b45688bcf8 (patch)
treea1168744379c82fa3c0a92e14373fcc3897fb435 /lisp
parentb3956d85c71c30af732a8bc035ed39421bafe11d (diff)
parentb98cf9cdabd710f89eb57645a163fd52db338404 (diff)
downloademacs-3ee1841f288b5b9cf9301945d10db2b45688bcf8.tar.gz
emacs-3ee1841f288b5b9cf9301945d10db2b45688bcf8.zip
Merge from origin/emacs-26
b98cf9c ; Fix a typo in the Emacs manual 700fcd7 * doc/emacs/help.texi: Fix paren typo. c9c0e40 More minor changes in shell-related nodes of Emacs manual e6bf19c Fix inaccuracies in "Shell Ring" node of Emacs manual 087681b8 Improve documentation of kmacro commands and variables. be2e8cb * doc/man/emacs.1.in: Document --fg-daemon and --bg-daemon. 1d9e66a Don't check non-X frames for z order (Bug#31373) 7dc028e Check NSWindow is actually a frame Conflicts: src/nsfns.m
Diffstat (limited to 'lisp')
-rw-r--r--lisp/kmacro.el38
1 files changed, 24 insertions, 14 deletions
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index 0acb7fce8f3..08a27aef5c6 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -226,12 +226,19 @@ macro to be executed before appending to it."
226;;; Keyboard macro counter 226;;; Keyboard macro counter
227 227
228(defvar kmacro-counter 0 228(defvar kmacro-counter 0
229 "Current keyboard macro counter.") 229 "Current keyboard macro counter.
230
231This is normally initialized to zero when the macro is defined,
232and incremented each time the value of the counter is inserted
233into a buffer. See `kmacro-start-macro-or-insert-counter' for
234more details.")
230 235
231(defvar kmacro-default-counter-format "%d") 236(defvar kmacro-default-counter-format "%d")
232 237
233(defvar kmacro-counter-format "%d" 238(defvar kmacro-counter-format "%d"
234 "Current keyboard macro counter format.") 239 "Current keyboard macro counter format.
240
241Can be set directly via `kmacro-set-format', which see.")
235 242
236(defvar kmacro-counter-format-start kmacro-counter-format 243(defvar kmacro-counter-format-start kmacro-counter-format
237 "Macro format at start of macro execution.") 244 "Macro format at start of macro execution.")
@@ -247,9 +254,9 @@ macro to be executed before appending to it."
247 254
248 255
249(defun kmacro-insert-counter (arg) 256(defun kmacro-insert-counter (arg)
250 "Insert macro counter, then increment it by ARG. 257 "Insert current value of `kmacro-counter', then increment it by ARG.
251Interactively, ARG defaults to 1. With \\[universal-argument], insert 258Interactively, ARG defaults to 1. With \\[universal-argument], insert
252previous `kmacro-counter', and do not modify counter." 259current value of `kmacro-counter', but do not increment it."
253 (interactive "P") 260 (interactive "P")
254 (if kmacro-initial-counter-value 261 (if kmacro-initial-counter-value
255 (setq kmacro-counter kmacro-initial-counter-value 262 (setq kmacro-counter kmacro-initial-counter-value
@@ -261,7 +268,7 @@ previous `kmacro-counter', and do not modify counter."
261 268
262 269
263(defun kmacro-set-format (format) 270(defun kmacro-set-format (format)
264 "Set macro counter FORMAT." 271 "Set the format of `kmacro-counter' to FORMAT."
265 (interactive "sMacro Counter Format: ") 272 (interactive "sMacro Counter Format: ")
266 (setq kmacro-counter-format 273 (setq kmacro-counter-format
267 (if (equal format "") "%d" format)) 274 (if (equal format "") "%d" format))
@@ -277,7 +284,7 @@ previous `kmacro-counter', and do not modify counter."
277 (format kmacro-counter-format value) value)) 284 (format kmacro-counter-format value) value))
278 285
279(defun kmacro-set-counter (arg) 286(defun kmacro-set-counter (arg)
280 "Set `kmacro-counter' to ARG or prompt if missing. 287 "Set the value of `kmacro-counter' to ARG, or prompt for value if no argument.
281With \\[universal-argument] prefix, reset counter to its value prior to this iteration of the macro." 288With \\[universal-argument] prefix, reset counter to its value prior to this iteration of the macro."
282 (interactive "NMacro counter value: ") 289 (interactive "NMacro counter value: ")
283 (if (not (or defining-kbd-macro executing-kbd-macro)) 290 (if (not (or defining-kbd-macro executing-kbd-macro))
@@ -291,7 +298,7 @@ With \\[universal-argument] prefix, reset counter to its value prior to this ite
291 298
292 299
293(defun kmacro-add-counter (arg) 300(defun kmacro-add-counter (arg)
294 "Add numeric prefix arg (prompt if missing) to macro counter. 301 "Add the value of numeric prefix arg (prompt if missing) to `kmacro-counter'.
295With \\[universal-argument], restore previous counter value." 302With \\[universal-argument], restore previous counter value."
296 (interactive "NAdd to macro counter: ") 303 (interactive "NAdd to macro counter: ")
297 (if kmacro-initial-counter-value 304 (if kmacro-initial-counter-value
@@ -670,18 +677,21 @@ use \\[kmacro-name-last-macro]."
670 "Record subsequent keyboard input, defining a keyboard macro. 677 "Record subsequent keyboard input, defining a keyboard macro.
671The commands are recorded even as they are executed. 678The commands are recorded even as they are executed.
672 679
673Sets the `kmacro-counter' to ARG (or 0 if no prefix arg) before defining the 680Initializes the macro's `kmacro-counter' to ARG (or 0 if no prefix arg)
674macro. 681before defining the macro.
675 682
676With \\[universal-argument], appends to current keyboard macro (keeping 683With \\[universal-argument], appends to current keyboard macro (keeping
677the current value of `kmacro-counter'). 684the current value of `kmacro-counter').
678 685
679When defining/executing macro, inserts macro counter and increments 686When used during defining/executing a macro, inserts the current value
680the counter with ARG or 1 if missing. With \\[universal-argument], 687of `kmacro-counter' and increments the counter value by ARG (or by 1 if no
681inserts previous `kmacro-counter' (but do not modify counter). 688prefix argument). With just \\[universal-argument], inserts the current value
689of `kmacro-counter', but does not modify the counter; this is the
690same as incrementing the counter by zero.
682 691
683The macro counter can be modified via \\[kmacro-set-counter] and \\[kmacro-add-counter]. 692The macro counter can be set directly via \\[kmacro-set-counter] and \\[kmacro-add-counter].
684The format of the counter can be modified via \\[kmacro-set-format]." 693The format of the inserted value of the counter can be controlled
694via \\[kmacro-set-format]."
685 (interactive "P") 695 (interactive "P")
686 (if (or defining-kbd-macro executing-kbd-macro) 696 (if (or defining-kbd-macro executing-kbd-macro)
687 (kmacro-insert-counter arg) 697 (kmacro-insert-counter arg)