diff options
| author | Richard M. Stallman | 1994-03-02 00:53:48 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-03-02 00:53:48 +0000 |
| commit | 41d1fb49f57904a1196a261136db103fae225ef9 (patch) | |
| tree | 3776aa1ba5891d8fd8950ebad8ae2e933466b25e | |
| parent | b5e8c6b79df9b4e1608b26d58d4ee3b461340ad9 (diff) | |
| download | emacs-41d1fb49f57904a1196a261136db103fae225ef9.tar.gz emacs-41d1fb49f57904a1196a261136db103fae225ef9.zip | |
(insert-kbd-macro): Handle C-@, C-[, etc. properly and their meta variants too.
| -rw-r--r-- | lisp/macros.el | 18 |
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." | |||
| 76 | (goto-char beg) | 76 | (goto-char beg) |
| 77 | (while (< (point) end) | 77 | (while (< (point) end) |
| 78 | (let ((char (following-char))) | 78 | (let ((char (following-char))) |
| 79 | (cond ((< char 32) | 79 | (cond ((= char 0) |
| 80 | (delete-region (point) (1+ (point))) | ||
| 81 | (insert "\\C-@")) | ||
| 82 | ((< char 27) | ||
| 80 | (delete-region (point) (1+ (point))) | 83 | (delete-region (point) (1+ (point))) |
| 81 | (insert "\\C-" (+ 96 char))) | 84 | (insert "\\C-" (+ 96 char))) |
| 85 | ((< char 32) | ||
| 86 | (delete-region (point) (1+ (point))) | ||
| 87 | (insert "\\C-" (+ 64 char))) | ||
| 82 | ((< char 127) | 88 | ((< char 127) |
| 83 | (forward-char 1)) | 89 | (forward-char 1)) |
| 84 | ((= char 127) | 90 | ((= char 127) |
| 85 | (delete-region (point) (1+ (point))) | 91 | (delete-region (point) (1+ (point))) |
| 86 | (insert "\\C-?")) | 92 | (insert "\\C-?")) |
| 93 | ((= char 128) | ||
| 94 | (delete-region (point) (1+ (point))) | ||
| 95 | (insert "\\M-\\C-@")) | ||
| 96 | ((< char 155) | ||
| 97 | (delete-region (point) (1+ (point))) | ||
| 98 | (insert "\\M-\\C-" (- char 32))) | ||
| 87 | ((< char 160) | 99 | ((< char 160) |
| 88 | (delete-region (point) (1+ (point))) | 100 | (delete-region (point) (1+ (point))) |
| 89 | (insert "\\M-C-" (- char 32))) | 101 | (insert "\\M-\\C-" (- char 64))) |
| 90 | ((< char 255) | 102 | ((< char 255) |
| 91 | (delete-region (point) (1+ (point))) | 103 | (delete-region (point) (1+ (point))) |
| 92 | (insert "\\M-" (- char 128))) | 104 | (insert "\\M-" (- char 128))) |
| 93 | ((= char 255) | 105 | ((= char 255) |
| 94 | (delete-region (point) (1+ (point))) | 106 | (delete-region (point) (1+ (point))) |
| 95 | (insert "\\M-C-?")))))) | 107 | (insert "\\M-\\C-?")))))) |
| 96 | (insert ")\n") | 108 | (insert ")\n") |
| 97 | (if keys | 109 | (if keys |
| 98 | (let ((keys (where-is-internal macroname '(keymap)))) | 110 | (let ((keys (where-is-internal macroname '(keymap)))) |