]> code.delx.au - gnu-emacs/blobdiff - lisp/macros.el
(compilation-error-regexp-alist): Make separate
[gnu-emacs] / lisp / macros.el
index 2ff40f81f9b3cd367f6084bac0488108aa4c3f52..8a921ac8d0757e264582ff30035e40a51f740a7d 100644 (file)
@@ -1,6 +1,6 @@
 ;;; macros.el --- non-primitive commands for keyboard macros.
 
-;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1986, 1987, 1992, 1994 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: abbrev
@@ -41,6 +41,7 @@ Such a \"function\" cannot be called from Lisp, but it is a valid editor command
       (error "No keyboard macro defined"))
   (and (fboundp symbol)
        (not (stringp (symbol-function symbol)))
+       (not (vectorp (symbol-function symbol)))
        (error "Function %s is already defined and not a keyboard macro."
              symbol))
   (fset symbol last-kbd-macro))
@@ -75,26 +76,38 @@ use this command, and then save the file."
       (goto-char beg)
       (while (< (point) end)
        (let ((char (following-char)))
-         (cond ((< char 32)
+         (cond ((= char 0)
+                (delete-region (point) (1+ (point)))
+                (insert "\\C-@"))
+               ((< char 27)
                 (delete-region (point) (1+ (point)))
                 (insert "\\C-" (+ 96 char)))
+               ((< char 32)
+                (delete-region (point) (1+ (point)))
+                (insert "\\C-" (+ 64 char)))
                ((< char 127)
                 (forward-char 1))
                ((= char 127)
                 (delete-region (point) (1+ (point)))
                 (insert "\\C-?"))
+               ((= char 128)
+                (delete-region (point) (1+ (point)))
+                (insert "\\M-\\C-@"))
+               ((< char 155)
+                (delete-region (point) (1+ (point)))
+                (insert "\\M-\\C-" (- char 32)))
                ((< char 160)
                 (delete-region (point) (1+ (point)))
-                (insert "\\M-C-" (- char 32)))
+                (insert "\\M-\\C-" (- char 64)))
                ((< char 255)
                 (delete-region (point) (1+ (point)))
                 (insert "\\M-" (- char 128)))
                ((= char 255)
                 (delete-region (point) (1+ (point)))
-                (insert "\\M-C-?"))))))
+                (insert "\\M-\\C-?"))))))
     (insert ")\n")
     (if keys
-       (let ((keys (where-is-internal macroname nil)))
+       (let ((keys (where-is-internal macroname '(keymap))))
          (while keys
            (insert "(global-set-key ")
            (prin1 (car keys) (current-buffer))
@@ -128,7 +141,7 @@ Your options are: \\<query-replace-map>
       (let ((loop t)
            (msg (substitute-command-keys
                  "Proceed with macro?\\<query-replace-map>\
- (\\[act], \\[skip], \\[exit], \\[recenter], \\[edit]")))
+ (\\[act], \\[skip], \\[exit], \\[recenter], \\[edit]")))
        (while loop
          (let ((key (let ((executing-macro nil)
                           (defining-kbd-macro nil))
@@ -158,7 +171,7 @@ Your options are: \\<query-replace-map>
                   (with-output-to-temp-buffer "*Help*"
                     (princ
                      (substitute-command-keys
-                      "Specify how to procede with keyboard macro execution.
+                      "Specify how to proceed with keyboard macro execution.
 Possibilities: \\<query-replace-map>
 \\[act]        Finish this iteration normally and continue with the next.
 \\[skip]       Skip the rest of this iteration, and start the next.
@@ -234,7 +247,6 @@ and then select the region of un-tablified names and use
       (set-marker end-marker nil)
       (set-marker next-line-marker nil))))
 
-;;;###autoload
-(define-key ctl-x-map "q" 'kbd-macro-query)
+;;;###autoload (define-key ctl-x-map "q" 'kbd-macro-query)
 
 ;;; macros.el ends here