changeset 6125:54625de47273

(insert-kbd-macro): Handle C-@, C-[, etc. properly and their meta variants too.
author Richard M. Stallman <rms@gnu.org>
date Wed, 02 Mar 1994 00:53:48 +0000
parents 56546a41a683
children 47d2f8f84309
files lisp/macros.el
diffstat 1 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/macros.el	Tue Mar 01 22:42:53 1994 +0000
+++ b/lisp/macros.el	Wed Mar 02 00:53:48 1994 +0000
@@ -76,23 +76,35 @@
       (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 '(keymap))))