summaryrefslogtreecommitdiff
path: root/lisp/use-package/use-package-ensure.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2017-12-05 11:10:16 -0800
committerJohn Wiegley <johnw@newartisans.com>2017-12-05 11:10:16 -0800
commit0a628a27675491bbf154b4c641876ec1124a59ae (patch)
tree410c6260d4d0972f5863ef8b7c644f7ccaa4785e /lisp/use-package/use-package-ensure.el
parenta090961f105595b6c9b56c0e5cda567c76687b06 (diff)
downloademacs-0a628a27675491bbf154b4c641876ec1124a59ae.tar.gz
emacs-0a628a27675491bbf154b4c641876ec1124a59ae.tar.bz2
emacs-0a628a27675491bbf154b4c641876ec1124a59ae.zip
Avoid using pcase and many other macros in macro-expanded forms
This is related to https://github.com/jwiegley/use-package/issues/550
Diffstat (limited to 'lisp/use-package/use-package-ensure.el')
-rw-r--r--lisp/use-package/use-package-ensure.el24
1 files changed, 13 insertions, 11 deletions
diff --git a/lisp/use-package/use-package-ensure.el b/lisp/use-package/use-package-ensure.el
index 1c9cd08ff19..46de5a8a3a4 100644
--- a/lisp/use-package/use-package-ensure.el
+++ b/lisp/use-package/use-package-ensure.el
@@ -138,17 +138,19 @@ manually updated package."
(list t)
(use-package-only-one (symbol-name keyword) args
#'(lambda (label arg)
- (pcase arg
- ((pred symbolp)
- (list arg))
- (`(,(and pkg (pred symbolp))
- :pin ,(and repo (or (pred stringp)
- (pred symbolp))))
- (list (cons pkg repo)))
- (_
- (use-package-error
- (concat ":ensure wants an optional package name "
- "(an unquoted symbol name), or (<symbol> :pin <string>)"))))))))
+ (cond
+ ((symbolp arg)
+ (list arg))
+ ((and (listp arg) (= 3 (length arg))
+ (symbolp (nth 0 arg))
+ (eq :pin (nth 1 arg))
+ (or (stringp (nth 2 arg))
+ (symbolp (nth 2 arg))))
+ (list (cons (nth 0 arg) (nth 2 arg))))
+ (t
+ (use-package-error
+ (concat ":ensure wants an optional package name "
+ "(an unquoted symbol name), or (<symbol> :pin <string>)"))))))))
(defun use-package-ensure-elpa (name args state &optional no-refresh)
(dolist (ensure args)