Lower the priority of :if/:when/:unless in use-package-keywords

Fixes https://github.com/jwiegley/use-package/issues/560
This commit is contained in:
John Wiegley 2017-12-05 13:26:32 -08:00
parent 64ffdb6863
commit b25a305c58
2 changed files with 21 additions and 3 deletions

View file

@ -55,13 +55,13 @@
(defcustom use-package-keywords
'(:disabled
:if :when :unless
:requires
:load-path
:no-require
:requires
:defines
:functions
:preface
:if :when :unless
:no-require
:catch
:after
:custom

View file

@ -1663,6 +1663,24 @@
("C-c C-r" . org-ref-helm-insert-cite-link))
`(bind-key "C-c C-r" #'org-ref-helm-insert-cite-link override-global-map nil)))
(ert-deftest use-package-test/560 ()
(match-expansion
(use-package notmuch
:preface (setq-default notmuch-command (executable-find "notmuch"))
:if notmuch-command
:requires foo
:load-path "my-load-path"
:defines var)
`(progn
(eval-and-compile
(add-to-list 'load-path "/Users/johnw/.emacs.d/my-load-path"))
(when (featurep 'foo)
(eval-and-compile
(setq-default notmuch-command
(executable-find "notmuch")))
(when (symbol-value 'notmuch-command)
(require 'notmuch nil nil))))))
(ert-deftest bind-key/:prefix-map ()
(match-expansion
(bind-keys :prefix "<f1>"