projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ffa5f03
)
optimization: constand folding for read-kbd-macro
author
Wang Chunye
<chunywan@xilinx.com>
Fri, 20 Mar 2020 13:25:35 +0000
(06:25 -0700)
committer
Wang Chunye
<chunywan@xilinx.com>
Sun, 6 Feb 2022 13:23:46 +0000
(21:23 +0800)
to boost startup performance, it is better to avoid invoking
`read-kbd-macro` at run time which requires 'cl-lib.
it takes ~20ms to load cl-lib
Copyright-paperwork-exempt: yes
lisp/use-package/bind-key.el
patch
|
blob
|
history
diff --git
a/lisp/use-package/bind-key.el
b/lisp/use-package/bind-key.el
index 1d611c2933cb55589e69c8b00ddee2da37771c79..919a1772131d66e5dc1353538abd6f5f253b93a1 100644
(file)
--- a/
lisp/use-package/bind-key.el
+++ b/
lisp/use-package/bind-key.el
@@
-172,8
+172,9
@@
can safely be called at any time."
(kdescvar (make-symbol "kdesc"))
(bindingvar (make-symbol "binding")))
`(let* ((,namevar ,key-name)
- (,keyvar (if (vectorp ,namevar) ,namevar
- (read-kbd-macro ,namevar)))
+ (,keyvar ,(if (stringp key-name) (read-kbd-macro key-name)
+ `(if (vectorp ,namevar) ,namevar
+ (read-kbd-macro ,namevar))))
(,kmapvar (or (if (and ,keymap (symbolp ,keymap))
(symbol-value ,keymap) ,keymap)
global-map))