From: Justin Burkett Date: Mon, 4 Jun 2018 01:38:20 +0000 (-0400) Subject: Correct prefix keys after use-package-autoload-keymap X-Git-Tag: emacs-29.0.90~1306^2~15^2~64^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c980371f6f;p=emacs.git Correct prefix keys after use-package-autoload-keymap By adding events of the form (cons t event) to unread-command-events, Emacs correctly updates this-command-keys for the subsequent use of the prefix. Before this change, packages like my which-key were not getting the correct prefix after use-package-autoload-keymap loaded the relevant package. See https://github.com/justbur/emacs-which-key/issues/192 --- diff --git a/lisp/use-package/use-package-bind-key.el b/lisp/use-package/use-package-bind-key.el index d17ecb2cf75..8852f9188ba 100644 --- a/lisp/use-package/use-package-bind-key.el +++ b/lisp/use-package/use-package-bind-key.el @@ -61,7 +61,8 @@ deferred until the prefix key sequence is pressed." (bind-key* key keymap) (bind-key key keymap)) (setq unread-command-events - (listify-key-sequence kv))) + (mapcar (lambda (ev) (cons t ev)) + (listify-key-sequence kv)))) (use-package-error (format "package.el %s failed to define keymap %s" package keymap-symbol)))))