Mercurial > emacs
changeset 95148:97ef76fbfb23
(insert-kbd-macro): Use prin1-char.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Wed, 21 May 2008 02:32:31 +0000 |
parents | 5d23775277d2 |
children | 1b1b163d3028 |
files | lisp/ChangeLog lisp/macros.el |
diffstat | 2 files changed, 7 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Tue May 20 23:37:27 2008 +0000 +++ b/lisp/ChangeLog Wed May 21 02:32:31 2008 +0000 @@ -1,3 +1,7 @@ +2008-05-21 Stefan Monnier <monnier@iro.umontreal.ca> + + * macros.el (insert-kbd-macro): Use prin1-char. + 2008-05-20 Stefan Monnier <monnier@iro.umontreal.ca> * minibuffer.el (completion-boundaries): New function.
--- a/lisp/macros.el Tue May 20 23:37:27 2008 +0000 +++ b/lisp/macros.el Wed May 21 02:32:31 2008 +0000 @@ -131,41 +131,9 @@ (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")