summaryrefslogtreecommitdiff
path: root/lisp/use-package
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2017-11-28 16:27:09 -0800
committerJohn Wiegley <johnw@newartisans.com>2017-11-28 16:27:09 -0800
commit7531c374bf9cd1074ac1a1d2ec2cdb13ad4168d5 (patch)
treec0d72462dffe1762b0e1e67ad46fd172c4dd6564 /lisp/use-package
parentc811637b303db7bb951e54f651da0ce4528ef130 (diff)
downloademacs-7531c374bf9cd1074ac1a1d2ec2cdb13ad4168d5.tar.gz
emacs-7531c374bf9cd1074ac1a1d2ec2cdb13ad4168d5.tar.bz2
emacs-7531c374bf9cd1074ac1a1d2ec2cdb13ad4168d5.zip
Allow :diminish to take no argument, once again
Diffstat (limited to 'lisp/use-package')
-rw-r--r--lisp/use-package/use-package.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el
index a2ce335d1d8..d9ec638474e 100644
--- a/lisp/use-package/use-package.el
+++ b/lisp/use-package/use-package.el
@@ -829,10 +829,12 @@ If the package is installed, its entry is removed from
;;; :requires
;;
-(defun use-package-as-one (label args f)
- "Call F on the first element of ARGS if it has one element, or all of ARGS."
+(defun use-package-as-one (label args f &optional allow-empty)
+ "Call F on the first element of ARGS if it has one element, or all of ARGS.
+If ALLOW-EMPTY is non-nil, it's OK for ARGS to be an empty list."
(declare (indent 1))
- (if (and (not (null args)) (listp args) (listp (cdr args)))
+ (if (or (and (not (null args)) (listp args) (listp (cdr args)))
+ (and allow-empty (null args)))
(if (= (length args) 1)
(funcall f label (car args))
(funcall f label args))
@@ -1546,7 +1548,7 @@ deferred until the prefix key sequence is pressed."
(defun use-package-normalize/:diminish (name keyword args)
(use-package-as-one (symbol-name keyword) args
- (apply-partially #'use-package-normalize-diminish name)))
+ (apply-partially #'use-package-normalize-diminish name) t))
(defun use-package-handler/:diminish (name keyword arg rest state)
(let ((body (use-package-process-keywords name rest state)))