branch: externals/setup
commit 43092c20223605b0ef5b745f19e90e574f72f216
Author: Philip K <phil...@posteo.net>
Commit: Philip K <phil...@posteo.net>

    Mention if no local macros are defined in setup docstring
---
 setup.el | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/setup.el b/setup.el
index b1a4724..c53a821 100644
--- a/setup.el
+++ b/setup.el
@@ -82,19 +82,21 @@ Do not modify this variable by hand.  Instead use
   "Return a docstring for `setup'."
   (with-temp-buffer
     (insert (documentation (symbol-function 'setup) 'raw)
-            "\n\n"
-            "Within BODY, `setup' provides these local macros:")
-    (dolist (sym (sort (mapcar #'car setup-macros) #'string-lessp))
-      (newline 2)
-      (let ((sig (mapcar
-                  (lambda (arg)
-                    (if (string-match "\\`&" (symbol-name arg))
-                        arg
-                      (intern (upcase (symbol-name arg)))))
-                  (get sym 'setup-signature))))
-        (insert (format " - %s\n\n" (cons sym sig))
-                (or (get sym 'setup-documentation)
-                    "No documentation."))))
+            "\n\n")
+    (if (null setup-macros)
+        (insert "No local macros are defined.")
+      (insert "Within BODY, `setup' provides these local macros:")
+      (dolist (sym (sort (mapcar #'car setup-macros) #'string-lessp))
+        (newline 2)
+        (let ((sig (mapcar
+                    (lambda (arg)
+                      (if (string-match "\\`&" (symbol-name arg))
+                          arg
+                        (intern (upcase (symbol-name arg)))))
+                    (get sym 'setup-signature))))
+          (insert (format " - %s\n\n" (cons sym sig))
+                  (or (get sym 'setup-documentation)
+                      "No documentation.")))))
     (buffer-string)))
 
 ;;;###autoload

Reply via email to