summaryrefslogtreecommitdiff
path: root/lisp/use-package/use-package-core.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2017-12-09 16:28:49 -0800
committerJohn Wiegley <johnw@newartisans.com>2017-12-09 16:29:11 -0800
commitec84ed0dfbeebb8683330449aa4e476debd2f72c (patch)
tree717f0bbd1295ec79b925df7429a2e3de1e38f28a /lisp/use-package/use-package-core.el
parent5a02d61ac61d52e55bf642006f75afce95270376 (diff)
downloademacs-ec84ed0dfbeebb8683330449aa4e476debd2f72c.tar.gz
emacs-ec84ed0dfbeebb8683330449aa4e476debd2f72c.tar.bz2
emacs-ec84ed0dfbeebb8683330449aa4e476debd2f72c.zip
Fix a scoping issues with multiple occurrences of :bind
Fixes https://github.com/jwiegley/use-package/issues/585
Diffstat (limited to 'lisp/use-package/use-package-core.el')
-rw-r--r--lisp/use-package/use-package-core.el10
1 files changed, 9 insertions, 1 deletions
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