[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master c5e3815 1/2: Print macro modified macro keys as cha
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] master c5e3815 1/2: Print macro modified macro keys as characters not integers |
Date: |
Fri, 23 Aug 2019 08:39:19 -0400 (EDT) |
branch: master
commit c5e3815f4989ec5ed5e4cd507305e36c95ebb420
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
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).
---
lisp/macros.el | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/lisp/macros.el b/lisp/macros.el
index 4b38506..3470359 100644
--- a/lisp/macros.el
+++ b/lisp/macros.el
@@ -38,13 +38,13 @@
(defun macros--insert-vector-macro (definition)
"Print DEFINITION, a vector, into the current buffer."
- (dotimes (i (length definition))
- (let ((char (aref definition i)))
- (insert (if (zerop i) ?\[ ?\s))
- (if (characterp char)
- (princ (prin1-char char) (current-buffer))
- (prin1 char (current-buffer)))))
- (insert ?\]))
+ (insert ?\[
+ (mapconcat (lambda (event)
+ (or (prin1-char event)
+ (prin1-to-string event)))
+ definition
+ " ")
+ ?\]))
;;;###autoload
(defun insert-kbd-macro (macroname &optional keys)