diff options
| -rw-r--r-- | lisp/kmacro.el | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 9ee34a8432c..3f4ff73177f 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el | |||
| @@ -237,6 +237,8 @@ macro to be executed before appending to it." | |||
| 237 | (defvar kmacro-counter 0 | 237 | (defvar kmacro-counter 0 |
| 238 | "*Current keyboard macro counter.") | 238 | "*Current keyboard macro counter.") |
| 239 | 239 | ||
| 240 | (defvar kmacro-default-counter-format "%d") | ||
| 241 | |||
| 240 | (defvar kmacro-counter-format "%d" | 242 | (defvar kmacro-counter-format "%d" |
| 241 | "*Current keyboard macro counter format.") | 243 | "*Current keyboard macro counter format.") |
| 242 | 244 | ||
| @@ -268,12 +270,12 @@ With \\[universal-argument], insert previous kmacro-counter (but do not modify c | |||
| 268 | 270 | ||
| 269 | (defun kmacro-set-format (format) | 271 | (defun kmacro-set-format (format) |
| 270 | "Set macro counter FORMAT." | 272 | "Set macro counter FORMAT." |
| 271 | (interactive "sMacro Counter Format (printf format): ") | 273 | (interactive "sMacro Counter Format: ") |
| 272 | (setq kmacro-counter-format | 274 | (setq kmacro-counter-format |
| 273 | (if (equal format "") "%d" format)) | 275 | (if (equal format "") "%d" format)) |
| 274 | ;; redefine initial macro counter if we are not executing a macro. | 276 | ;; redefine initial macro counter if we are not executing a macro. |
| 275 | (if (not (or defining-kbd-macro executing-kbd-macro)) | 277 | (if (not (or defining-kbd-macro executing-kbd-macro)) |
| 276 | (setq kmacro-counter-format-start kmacro-counter-format))) | 278 | (setq kmacro-default-counter-format kmacro-counter-format))) |
| 277 | 279 | ||
| 278 | 280 | ||
| 279 | (defun kmacro-display-counter (&optional value) | 281 | (defun kmacro-display-counter (&optional value) |
| @@ -404,12 +406,12 @@ Optional arg EMPTY is message to print if no macros are defined." | |||
| 404 | (let* ((x 60) | 406 | (let* ((x 60) |
| 405 | (m (format-kbd-macro macro)) | 407 | (m (format-kbd-macro macro)) |
| 406 | (l (length m)) | 408 | (l (length m)) |
| 407 | (z (and nil trunc (> l x)))) | 409 | (z (and trunc (> l x)))) |
| 408 | (message (format "%s%s: %s%s" (or descr "Macro") | 410 | (message "%s%s: %s%s" (or descr "Macro") |
| 409 | (if (= kmacro-counter 0) "" | 411 | (if (= kmacro-counter 0) "" |
| 410 | (format " [%s]" | 412 | (format " [%s]" |
| 411 | (format kmacro-counter-format-start kmacro-counter))) | 413 | (format kmacro-counter-format-start kmacro-counter))) |
| 412 | (if z (substring m 0 (1- x)) m) (if z "..." "")))) | 414 | (if z (substring m 0 (1- x)) m) (if z "..." ""))) |
| 413 | (message (or empty "No keyboard macros defined")))) | 415 | (message (or empty "No keyboard macros defined")))) |
| 414 | 416 | ||
| 415 | 417 | ||
| @@ -588,7 +590,8 @@ Use \\[kmacro-bind-to-key] to bind it to a key sequence." | |||
| 588 | kmacro-initial-counter-value nil | 590 | kmacro-initial-counter-value nil |
| 589 | kmacro-counter-value-start kmacro-counter | 591 | kmacro-counter-value-start kmacro-counter |
| 590 | kmacro-last-counter kmacro-counter | 592 | kmacro-last-counter kmacro-counter |
| 591 | kmacro-counter-format-start kmacro-counter-format)) | 593 | kmacro-counter-format kmacro-default-counter-format |
| 594 | kmacro-counter-format-start kmacro-default-counter-format)) | ||
| 592 | 595 | ||
| 593 | (start-kbd-macro append | 596 | (start-kbd-macro append |
| 594 | (and append | 597 | (and append |