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
commit376a6fcaf40074c3956c2cd5cacbeeb0b965f6f7 (patch)
treecedb50fed8cb4674b1ea6cbd503328749dea3d59 /lisp/macros.el
parentb8269d5176848b2accfe082791c7901772c65930 (diff)
downloademacs-376a6fcaf40074c3956c2cd5cacbeeb0b965f6f7.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))))