diff options
author | John Wiegley <johnw@newartisans.com> | 2014-09-18 21:32:55 +0100 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2014-09-18 21:32:55 +0100 |
commit | 0bfa35614839c7830e11b30c82b17013661bec22 (patch) | |
tree | 05a93fc362c0e9a406326375bfa1e0581d42c066 /lisp/use-package | |
parent | 4c927efbd515c502da497219734d5187dd7abb8c (diff) | |
parent | e8ce1b20ca3a99a5763e2d5404941d9697252a01 (diff) | |
download | emacs-0bfa35614839c7830e11b30c82b17013661bec22.tar.gz emacs-0bfa35614839c7830e11b30c82b17013661bec22.tar.bz2 emacs-0bfa35614839c7830e11b30c82b17013661bec22.zip |
Merge pull request from waymondo/master
Add :bind* keyword for `bind-key*`
GitHub-reference: https://github.com/jwiegley/use-package/issues/126
Diffstat (limited to 'lisp/use-package')
-rw-r--r-- | lisp/use-package/use-package.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index 34ea1ca30e5..68aa3c9d0b6 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -146,6 +146,7 @@ Return nil when the queue is empty." (defvar use-package-keywords '( :bind + :bind* :commands :config :defer @@ -247,6 +248,8 @@ For full documentation. please see commentary. :init Code to run when `use-package' form evals. :bind Perform key bindings, and define autoload for bound commands. +:bind* Perform key bindings, and define autoload for bound + commands, overriding all minor mode bindings. :commands Define autoloads for given commands. :pre-load Code to run when `use-package' form evals and before anything else. Unlike :init this form runs before the @@ -254,7 +257,7 @@ For full documentation. please see commentary. :mode Form to be added to `auto-mode-alist'. :interpreter Form to be added to `interpreter-mode-alist'. :defer Defer loading of package -- automatic - if :commands, :bind, :mode or :interpreter are used. + if :commands, :bind, :bind*, :mode or :interpreter are used. :demand Prevent deferred loading in all cases. :config Runs if and when package loads. :if Conditional loading. @@ -279,6 +282,7 @@ For full documentation. please see commentary. (idle-body (use-package-plist-get args :idle)) (idle-priority (use-package-plist-get args :idle-priority)) (keybindings-alist (use-package-plist-get args :bind t t)) + (overriding-keybindings-alist (use-package-plist-get args :bind* t t)) (mode (use-package-plist-get args :mode t t)) (mode-alist (if (stringp mode) (cons mode name) mode)) @@ -372,6 +376,12 @@ For full documentation. please see commentary. keybindings-alist) (funcall init-for-commands + #'(lambda (binding) + `(bind-key* ,(car binding) + (quote ,(cdr binding)))) + overriding-keybindings-alist) + + (funcall init-for-commands #'(lambda (mode) `(add-to-list 'auto-mode-alist (quote ,mode))) |