summaryrefslogtreecommitdiff
path: root/lisp/use-package
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/use-package')
-rw-r--r--lisp/use-package/use-package-bind-key.el7
-rw-r--r--lisp/use-package/use-package-core.el10
2 files changed, 14 insertions, 3 deletions
diff --git a/lisp/use-package/use-package-bind-key.el b/lisp/use-package/use-package-bind-key.el
index b26c812bf58..d8fe56dfaa5 100644
--- a/lisp/use-package/use-package-bind-key.el
+++ b/lisp/use-package/use-package-bind-key.el
@@ -128,8 +128,11 @@ deferred until the prefix key sequence is pressed."
(name keyword args rest state &optional bind-macro)
(use-package-concat
(use-package-process-keywords name rest state)
- `((,(if bind-macro bind-macro 'bind-keys)
- :package ,name ,@(use-package-normalize-commands args)))))
+ `(,@(mapcar
+ #'(lambda (xs)
+ `(,(if bind-macro bind-macro 'bind-keys)
+ :package ,name ,@(use-package-normalize-commands xs)))
+ (use-package-split-list-at-keys :break args)))))
(defun use-package-handler/:bind* (name keyword arg rest state)
(use-package-handler/:bind name keyword arg rest state 'bind-keys*))
diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el
index e700c1c110b..df65e04b9a0 100644
--- a/lisp/use-package/use-package-core.el
+++ b/lisp/use-package/use-package-core.el
@@ -180,7 +180,8 @@ t according to whether defaulting should be attempted."
(defcustom use-package-merge-key-alist
'((:if . (lambda (new old) `(and ,new ,old)))
(:after . (lambda (new old) `(:all ,new ,old)))
- (:defer . (lambda (new old) old)))
+ (:defer . (lambda (new old) old))
+ (:bind . (lambda (new old) (append new (list :break) old))))
"Alist of keys and the functions used to merge multiple values.
For example, if the following form is provided:
@@ -472,6 +473,13 @@ This is in contrast to merely setting it to 0."
(nconc ys (list x)))))
(cons (cdr ys) (cdr zs))))
+(defun use-package-split-list-at-keys (key lst)
+ (when lst
+ (let* ((xs (use-package-split-list (apply-partially #'eq key) lst))
+ (args (car xs))
+ (tail (cdr xs)))
+ (cons args (use-package-split-list-at-keys key (cdr tail))))))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Keywords