diff options
Diffstat (limited to 'lisp/use-package/use-package.el')
-rw-r--r-- | lisp/use-package/use-package.el | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index 0eaa1ac3371..78abd9f776f 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -181,16 +181,16 @@ ARGS is a list of forms, so `((foo))' if only `foo' is being called." (when body `((when ,(macroexp-progn (use-package-expand name-string (format "pre-%s hook" keyword) - `(run-hook-with-args-until-failure - ',(intern (concat "use-package--" name-string - "--pre-" keyword-name "-hook"))))) + `((run-hook-with-args-until-failure + ',(intern (concat "use-package--" name-string + "--pre-" keyword-name "-hook")))))) ,(macroexp-progn (use-package-expand name-string (format "%s" keyword) body)) ,(macroexp-progn (use-package-expand name-string (format "post-%s hook" keyword) - `(run-hooks - ',(intern (concat "use-package--" name-string - "--post-" keyword-name "-hook"))))))))))) + `((run-hooks + ',(intern (concat "use-package--" name-string + "--post-" keyword-name "-hook")))))))))))) (defun use-package--with-elapsed-timer (text body) "BODY is a list of forms, so `((foo))' if only `foo' is being called." @@ -679,37 +679,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) |