branch: externals/ef-themes
commit 469ed40d3f523914501b93ee72ceb21d72a8d435
Author: Philip Kaludercic <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>

    Replace 'ef-themes--height' with a dotimes
    
    As the macro is not used anywhere else, we can replace the explicit
    repetition with a macro that invokes the result of
    'ef-themes--height's macro-expansion.
---
 ef-themes.el | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/ef-themes.el b/ef-themes.el
index 5683260936..9a85a07064 100644
--- a/ef-themes.el
+++ b/ef-themes.el
@@ -443,23 +443,11 @@ Helper function for `ef-themes-preview-colors'."
   :tag "Ef Themes Faces")
 
 ;; This produces `ef-themes-height-0' and the like.
-(defmacro ef-themes--height (n)
-  "Write `defface' for height level N."
-  `(defface ,(intern (format "ef-themes-heading-%s" n)) nil
-     ,(format "Used for level %s heading." n)
-     :group 'ef-themes-faces))
-
-;; FIXME 2022-08-18: Why won't `dotimes' work with the macro?  (dotimes
-;; (n 8) ...) does not interpret the n as a number.
-(ef-themes--height 0)
-(ef-themes--height 1)
-(ef-themes--height 2)
-(ef-themes--height 3)
-(ef-themes--height 4)
-(ef-themes--height 5)
-(ef-themes--height 6)
-(ef-themes--height 7)
-(ef-themes--height 8)
+(dotimes (n 8)
+  (custom-declare-face
+    (intern (format "ef-themes-heading-%d" n))
+    nil (format "Used for level %d heading." n)
+    :group 'ef-themes-faces))
 
 (defconst ef-themes-faces
   '(

Reply via email to