]> git.eshelyaron.com Git - emacs.git/commitdiff
Lower the priority of :if/:when/:unless in use-package-keywords
authorJohn Wiegley <johnw@newartisans.com>
Tue, 5 Dec 2017 21:26:32 +0000 (13:26 -0800)
committerJohn Wiegley <johnw@newartisans.com>
Tue, 5 Dec 2017 21:26:32 +0000 (13:26 -0800)
Fixes https://github.com/jwiegley/use-package/issues/560

lisp/use-package/use-package-core.el
test/lisp/use-package/use-package-tests.el

index c1d5233e1ede37351d1811fd22a261f6c0a7d7de..b46bdfa8651b30be563a222573357e2debdb767a 100644 (file)
 
 (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
index 7109d58ea1f7c3cc9173813eac805fb87a47171d..a47188f8ecc7178769756968a96b28164baf5852 100644 (file)
                ("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>"