From: Wang Chunye Date: Fri, 20 Mar 2020 13:25:35 +0000 (-0700) Subject: optimization: constand folding for read-kbd-macro X-Git-Tag: emacs-29.0.90~1306^2~15^2~31^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9be2580f5f;p=emacs.git optimization: constand folding for read-kbd-macro 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 --- diff --git a/lisp/use-package/bind-key.el b/lisp/use-package/bind-key.el index 1d611c2933c..919a1772131 100644 --- 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))