diff options
-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." (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)))) |