diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-05-21 02:32:31 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-05-21 02:32:31 +0000 |
commit | 59f3685985af13a64a7e390c13962f2b074c36eb (patch) | |
tree | 56c867d7178953957065df95f34f4692d7c46773 /lisp/macros.el | |
parent | 5c2a72d900a7b0615149c1f775144aea41f9e159 (diff) | |
download | emacs-59f3685985af13a64a7e390c13962f2b074c36eb.tar.gz |
(insert-kbd-macro): Use prin1-char.
Diffstat (limited to 'lisp/macros.el')
-rw-r--r-- | lisp/macros.el | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/lisp/macros.el b/lisp/macros.el index 4f0194ea595..f8d0b5af92e 100644 --- a/lisp/macros.el +++ b/lisp/macros.el @@ -131,41 +131,9 @@ use this command, and then save the file." (insert (if (zerop i) ?\[ ?\s)) (setq char (aref definition i) i (1+ i)) - (cond ((not (numberp char)) - (prin1 char (current-buffer))) - (t - (insert "?") - (setq mods (event-modifiers char) - char (event-basic-type char)) - (while mods - (cond ((eq (car mods) 'control) - (insert "\\C-")) - ((eq (car mods) 'meta) - (insert "\\M-")) - ((eq (car mods) 'hyper) - (insert "\\H-")) - ((eq (car mods) 'super) - (insert "\\s-")) - ((eq (car mods) 'alt) - (insert "\\A-")) - ((and (eq (car mods) 'shift) - (>= char ?a) - (<= char ?z)) - (setq char (upcase char))) - ((eq (car mods) 'shift) - (insert "\\S-"))) - (setq mods (cdr mods))) - (cond ((= char ?\\) - (insert "\\\\")) - ((= char ?\") - (insert "\\\"")) - ((= char ?\;) - (insert "\\;")) - ((= char 127) - (insert "\\C-?")) - ((< char 127) - (insert char)) - (t (insert "\\" (format "%o" char))))))) + (if (not (numberp char)) + (prin1 char (current-buffer)) + (princ (prin1-char char) (current-buffer)))) (insert ?\])) (prin1 definition (current-buffer)))) (insert ")\n") |