changeset 58718:9a437a7c791c

(kmacro-default-counter-format): New var. (kmacro-set-format): Use it. Delete `(printf format)' from prompt. (kmacro-display): Remove `nil' from `and' form. Delete call to `format' inside `message'. (kmacro-start-macro): Use `kmacro-default-counter-format'.
author Luc Teirlinck <teirllm@auburn.edu>
date Thu, 02 Dec 2004 00:17:54 +0000
parents bd9d0c90fd28
children 939c9f3f6cd6
files lisp/kmacro.el
diffstat 1 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/kmacro.el	Wed Dec 01 22:35:15 2004 +0000
+++ b/lisp/kmacro.el	Thu Dec 02 00:17:54 2004 +0000
@@ -237,6 +237,8 @@
 (defvar kmacro-counter 0
   "*Current keyboard macro counter.")
 
+(defvar kmacro-default-counter-format "%d")
+
 (defvar kmacro-counter-format "%d"
   "*Current keyboard macro counter format.")
 
@@ -268,12 +270,12 @@
 
 (defun kmacro-set-format (format)
   "Set macro counter FORMAT."
-  (interactive "sMacro Counter Format (printf format): ")
+  (interactive "sMacro Counter Format: ")
   (setq kmacro-counter-format
 	(if (equal format "") "%d" format))
   ;; redefine initial macro counter if we are not executing a macro.
   (if (not (or defining-kbd-macro executing-kbd-macro))
-      (setq kmacro-counter-format-start kmacro-counter-format)))
+      (setq kmacro-default-counter-format kmacro-counter-format)))
 
 
 (defun kmacro-display-counter (&optional value)
@@ -404,12 +406,12 @@
       (let* ((x 60)
 	     (m (format-kbd-macro macro))
 	     (l (length m))
-	     (z (and nil trunc (> l x))))
-	(message (format "%s%s: %s%s" (or descr "Macro")
-			 (if (= kmacro-counter 0) ""
-			   (format " [%s]"
-				   (format kmacro-counter-format-start kmacro-counter)))
-			 (if z (substring m 0 (1- x)) m) (if z "..." ""))))
+	     (z (and trunc (> l x))))
+	(message "%s%s: %s%s" (or descr "Macro")
+		 (if (= kmacro-counter 0) ""
+		   (format " [%s]"
+			   (format kmacro-counter-format-start kmacro-counter)))
+		 (if z (substring m 0 (1- x)) m) (if z "..." "")))
     (message (or empty "No keyboard macros defined"))))
 
 
@@ -588,7 +590,8 @@
 	      kmacro-initial-counter-value nil
 	      kmacro-counter-value-start kmacro-counter
 	      kmacro-last-counter kmacro-counter
-	      kmacro-counter-format-start kmacro-counter-format))
+	      kmacro-counter-format kmacro-default-counter-format
+	      kmacro-counter-format-start kmacro-default-counter-format))
 
       (start-kbd-macro append
 		       (and append