summaryrefslogtreecommitdiff
path: root/lisp/macros.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-03-02 00:53:48 +0000
committerRichard M. Stallman <rms@gnu.org>1994-03-02 00:53:48 +0000
commit41d1fb49f57904a1196a261136db103fae225ef9 (patch)
tree3776aa1ba5891d8fd8950ebad8ae2e933466b25e /lisp/macros.el
parentb5e8c6b79df9b4e1608b26d58d4ee3b461340ad9 (diff)
downloademacs-41d1fb49f57904a1196a261136db103fae225ef9.tar.gz
(insert-kbd-macro): Handle C-@, C-[, etc. properly and their meta variants too.
Diffstat (limited to 'lisp/macros.el')
-rw-r--r--lisp/macros.el18
1 files changed, 15 insertions, 3 deletions
diff --git a/lisp/macros.el b/lisp/macros.el
index cbb612494b0..7662c1e8988 100644
--- a/lisp/macros.el
+++ b/lisp/macros.el
@@ -76,23 +76,35 @@ 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 '(keymap))))