From b25a305c588744b51276d2c4245d0a268f4d42f9 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 5 Dec 2017 13:26:32 -0800 Subject: [PATCH] Lower the priority of :if/:when/:unless in use-package-keywords Fixes https://github.com/jwiegley/use-package/issues/560 --- lisp/use-package/use-package-core.el | 6 +++--- test/lisp/use-package/use-package-tests.el | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index c1d5233e1ed..b46bdfa8651 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el @@ -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 diff --git a/test/lisp/use-package/use-package-tests.el b/test/lisp/use-package/use-package-tests.el index 7109d58ea1f..a47188f8ecc 100644 --- a/test/lisp/use-package/use-package-tests.el +++ b/test/lisp/use-package/use-package-tests.el @@ -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 "" -- 2.39.2