237 |
(defvar kmacro-counter 0 |
(defvar kmacro-counter 0 |
238 |
"*Current keyboard macro counter.") |
"*Current keyboard macro counter.") |
239 |
|
|
240 |
|
(defvar kmacro-default-counter-format "%d") |
241 |
|
|
242 |
(defvar kmacro-counter-format "%d" |
(defvar kmacro-counter-format "%d" |
243 |
"*Current keyboard macro counter format.") |
"*Current keyboard macro counter format.") |
244 |
|
|
270 |
|
|
271 |
(defun kmacro-set-format (format) |
(defun kmacro-set-format (format) |
272 |
"Set macro counter FORMAT." |
"Set macro counter FORMAT." |
273 |
(interactive "sMacro Counter Format (printf format): ") |
(interactive "sMacro Counter Format: ") |
274 |
(setq kmacro-counter-format |
(setq kmacro-counter-format |
275 |
(if (equal format "") "%d" format)) |
(if (equal format "") "%d" format)) |
276 |
;; redefine initial macro counter if we are not executing a macro. |
;; redefine initial macro counter if we are not executing a macro. |
277 |
(if (not (or defining-kbd-macro executing-kbd-macro)) |
(if (not (or defining-kbd-macro executing-kbd-macro)) |
278 |
(setq kmacro-counter-format-start kmacro-counter-format))) |
(setq kmacro-default-counter-format kmacro-counter-format))) |
279 |
|
|
280 |
|
|
281 |
(defun kmacro-display-counter (&optional value) |
(defun kmacro-display-counter (&optional value) |
406 |
(let* ((x 60) |
(let* ((x 60) |
407 |
(m (format-kbd-macro macro)) |
(m (format-kbd-macro macro)) |
408 |
(l (length m)) |
(l (length m)) |
409 |
(z (and nil trunc (> l x)))) |
(z (and trunc (> l x)))) |
410 |
(message (format "%s%s: %s%s" (or descr "Macro") |
(message "%s%s: %s%s" (or descr "Macro") |
411 |
(if (= kmacro-counter 0) "" |
(if (= kmacro-counter 0) "" |
412 |
(format " [%s]" |
(format " [%s]" |
413 |
(format kmacro-counter-format-start kmacro-counter))) |
(format kmacro-counter-format-start kmacro-counter))) |
414 |
(if z (substring m 0 (1- x)) m) (if z "..." "")))) |
(if z (substring m 0 (1- x)) m) (if z "..." ""))) |
415 |
(message (or empty "No keyboard macros defined")))) |
(message (or empty "No keyboard macros defined")))) |
416 |
|
|
417 |
|
|
590 |
kmacro-initial-counter-value nil |
kmacro-initial-counter-value nil |
591 |
kmacro-counter-value-start kmacro-counter |
kmacro-counter-value-start kmacro-counter |
592 |
kmacro-last-counter kmacro-counter |
kmacro-last-counter kmacro-counter |
593 |
kmacro-counter-format-start kmacro-counter-format)) |
kmacro-counter-format kmacro-default-counter-format |
594 |
|
kmacro-counter-format-start kmacro-default-counter-format)) |
595 |
|
|
596 |
(start-kbd-macro append |
(start-kbd-macro append |
597 |
(and append |
(and append |