emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/setup 1861d8c 22/24: Handle nil feature in :with-featur


From: Stefan Monnier
Subject: [elpa] externals/setup 1861d8c 22/24: Handle nil feature in :with-feature
Date: Thu, 25 Mar 2021 13:42:38 -0400 (EDT)

branch: externals/setup
commit 1861d8c05e4b786c28a9e48a43016fb238a73871
Author: Philip K <philipk@posteo.net>
Commit: Philip K <philipk@posteo.net>

    Handle nil feature in :with-feature
---
 setup.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/setup.el b/setup.el
index 01f035f..9f95b19 100644
--- a/setup.el
+++ b/setup.el
@@ -205,12 +205,14 @@ If not given, it is assumed nothing is evaluated."
 
 (setup-define :with-feature
   (lambda (feature &rest body)
-    `(let ((setup-name ',feature))
-       (ignore setup-name)
-       (:with-mode ,(if (string-match-p "-mode\\'" (symbol-name feature))
-                        feature
-                      (intern (format "%s-mode" feature)))
-         ,@body)))
+    (if feature
+        `(let ((setup-name ',feature))
+           (ignore setup-name)
+           (:with-mode ,(if (string-match-p "-mode\\'" (symbol-name feature))
+                            feature
+                          (intern (format "%s-mode" feature)))
+             ,@body))
+      `(progn ,@body)))
   :documentation "Change the FEATURE that BODY is configuring."
   :debug '(sexp setup)
   :indent 1)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]