From: Russell Black Date: Sun, 12 Apr 2015 00:08:58 +0000 (-0600) Subject: bind-keymap fixes X-Git-Tag: emacs-29.0.90~1306^2~15^2~339^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a53b5062c4c275bde5b86b5065bbc34a72a09ef7;p=emacs.git bind-keymap fixes Override argument no longer ignored. Not adding keymap to list of commands. `eval' no longer appears to be necessary, using direct invocation of bind-key*. --- diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index 6feb0d84a5c..400616d3b5e 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -674,37 +674,35 @@ deferred until the prefix key sequence is pressed." (use-package-error (format "Could not load package.el: %s" package)) (if (and (boundp keymap-symbol) (keymapp (symbol-value keymap-symbol))) - (let ((key (key-description (this-command-keys-vector))) - (keymap (symbol-value keymap-symbol))) + (let* ((kv (this-command-keys-vector)) + (key (key-description kv)) + (keymap (symbol-value keymap-symbol))) (if override - ;; eval form is necessary to avoid compiler error - `(eval `(bind-key* ,key ,keymap)) + (bind-key* key keymap) (bind-key key keymap)) (setq unread-command-events - (listify-key-sequence (this-command-keys-vector)))) + (listify-key-sequence kv))) (use-package-error (format "use-package: package.el %s failed to define keymap %s" package keymap-symbol))))) (defun use-package-handler/:bind-keymap (name-symbol keyword arg rest state &optional override) - (let* (commands - (form (mapcar - #'(lambda (binding) - (push (cdr binding) commands) - `(,(if override - 'bind-key* - 'bind-key) - ,(car binding) - #'(lambda () - (interactive) - (use-package-autoload-keymap - ',(cdr binding) ',name-symbol nil)))) arg))) + (let ((form (mapcar + #'(lambda (binding) + `(,(if override + 'bind-key* + 'bind-key) + ,(car binding) + #'(lambda () + (interactive) + (use-package-autoload-keymap + ',(cdr binding) ',name-symbol ,override)))) arg))) (use-package-concat (use-package-process-keywords name-symbol (use-package-sort-keywords (use-package-plist-maybe-put rest :defer t)) - (use-package-plist-append state :commands commands)) + state) `((ignore ,@form))))) (defun use-package-handler/:bind-keymap* (name-symbol keyword arg rest state)