]> code.delx.au - gnu-emacs/blobdiff - lisp/macros.el
Comment changes.
[gnu-emacs] / lisp / macros.el
index 69a95a35051e4c6ec68a56accf5c2bb25df3ea8f..11fa2223a4e431613f87466037ddfc69bc58b3f9 100644 (file)
@@ -1,4 +1,4 @@
-;;; macros.el --- non-primitive commands for keyboard macros.
+;;; macros.el --- non-primitive commands for keyboard macros
 
 ;; Copyright (C) 1985, 86, 87, 92, 94, 95 Free Software Foundation, Inc.
 
@@ -43,8 +43,10 @@ Such a \"function\" cannot be called from Lisp, but it is a valid editor command
   (and (fboundp symbol)
        (not (stringp (symbol-function symbol)))
        (not (vectorp (symbol-function symbol)))
-       (error "Function %s is already defined and not a keyboard macro."
+       (error "Function %s is already defined and not a keyboard macro"
              symbol))
+  (if (string-equal symbol "")
+      (error "No command name given"))
   (fset symbol last-kbd-macro))
 
 ;;;###autoload
@@ -148,6 +150,8 @@ use this command, and then save the file."
                       (setq mods (cdr mods)))
                     (cond ((= char ?\\)
                            (insert "\\\\"))
+                          ((= char ?\;)
+                           (insert "\\;"))
                           ((= char 127)
                            (insert "\\C-?"))
                           ((< char 127)
@@ -180,22 +184,22 @@ Your options are: \\<query-replace-map>
 \\[recenter]   Redisplay the screen, then ask again.
 \\[edit]       Enter recursive edit; ask again when you exit from that."
   (interactive "P")
-  (or executing-macro
+  (or executing-kbd-macro
       defining-kbd-macro
       (error "Not defining or executing kbd macro"))
   (if flag
-      (let (executing-macro defining-kbd-macro)
+      (let (executing-kbd-macro defining-kbd-macro)
        (recursive-edit))
-    (if (not executing-macro)
+    (if (not executing-kbd-macro)
        nil
       (let ((loop t)
            (msg (substitute-command-keys
                  "Proceed with macro?\\<query-replace-map>\
  (\\[act], \\[skip], \\[exit], \\[recenter], \\[edit]) ")))
        (while loop
-         (let ((key (let ((executing-macro nil)
+         (let ((key (let ((executing-kbd-macro nil)
                           (defining-kbd-macro nil))
-                      (message msg)
+                      (message "%s" msg)
                       (read-event)))
                def)
            (setq key (vector key))
@@ -204,14 +208,14 @@ Your options are: \\<query-replace-map>
                   (setq loop nil))
                  ((eq def 'skip)
                   (setq loop nil)
-                  (setq executing-macro ""))
+                  (setq executing-kbd-macro ""))
                  ((eq def 'exit)
                   (setq loop nil)
-                  (setq executing-macro t))
+                  (setq executing-kbd-macro t))
                  ((eq def 'recenter)
                   (recenter nil))
                  ((eq def 'edit)
-                  (let (executing-macro defining-kbd-macro)
+                  (let (executing-kbd-macro defining-kbd-macro)
                     (recursive-edit)))
                  ((eq def 'quit)
                   (setq quit-flag t))
@@ -277,7 +281,7 @@ and then select the region of un-tablified names and use
   (or macro
       (progn
        (if (null last-kbd-macro)
-           (error "No keyboard macro has been defined."))
+           (error "No keyboard macro has been defined"))
        (setq macro last-kbd-macro)))
   (save-excursion
     (let ((end-marker (progn
@@ -295,10 +299,13 @@ and then select the region of un-tablified names and use
          (forward-line 1)
          (set-marker next-line-marker (point)))
        (save-excursion
-         (execute-kbd-macro (or macro last-kbd-macro))))
+         (let ((mark-active nil))
+           (execute-kbd-macro (or macro last-kbd-macro)))))
       (set-marker end-marker nil)
       (set-marker next-line-marker nil))))
 
 ;;;###autoload (define-key ctl-x-map "q" 'kbd-macro-query)
 
+(provide 'macros)
+
 ;;; macros.el ends here