diff options
| author | Noam Postavsky | 2019-08-23 07:55:09 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2019-08-23 08:38:45 -0400 |
| commit | c5e3815f4989ec5ed5e4cd507305e36c95ebb420 (patch) | |
| tree | e4db8923a01534033264233ea1e73adc920ed9fe | |
| parent | f38901d431ba6dfe5dd9ebbe32f24afa16f129bd (diff) | |
| download | emacs-c5e3815f4989ec5ed5e4cd507305e36c95ebb420.tar.gz emacs-c5e3815f4989ec5ed5e4cd507305e36c95ebb420.zip | |
Print macro modified macro keys as characters not integers
* lisp/macros.el (macros--insert-vector-macro): Pass all elements to
'prin1-char', not just those that satisfy characterp (because characters
which have modifier bits set wouldn't qualify otherwise).
'prin1-char' will return nil if it can't handle the argument (e.g.,
for symbols representing function keys).
| -rw-r--r-- | lisp/macros.el | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lisp/macros.el b/lisp/macros.el index 4b38506d8a5..3470359c0ca 100644 --- a/lisp/macros.el +++ b/lisp/macros.el | |||
| @@ -38,13 +38,13 @@ | |||
| 38 | 38 | ||
| 39 | (defun macros--insert-vector-macro (definition) | 39 | (defun macros--insert-vector-macro (definition) |
| 40 | "Print DEFINITION, a vector, into the current buffer." | 40 | "Print DEFINITION, a vector, into the current buffer." |
| 41 | (dotimes (i (length definition)) | 41 | (insert ?\[ |
| 42 | (let ((char (aref definition i))) | 42 | (mapconcat (lambda (event) |
| 43 | (insert (if (zerop i) ?\[ ?\s)) | 43 | (or (prin1-char event) |
| 44 | (if (characterp char) | 44 | (prin1-to-string event))) |
| 45 | (princ (prin1-char char) (current-buffer)) | 45 | definition |
| 46 | (prin1 char (current-buffer))))) | 46 | " ") |
| 47 | (insert ?\])) | 47 | ?\])) |
| 48 | 48 | ||
| 49 | ;;;###autoload | 49 | ;;;###autoload |
| 50 | (defun insert-kbd-macro (macroname &optional keys) | 50 | (defun insert-kbd-macro (macroname &optional keys) |