]> git.eshelyaron.com Git - emacs.git/commitdiff
Use a single let binding when expanding consecutive :custom forms
authorJohann Klähn <johann@jklaehn.de>
Wed, 3 Feb 2021 21:55:17 +0000 (22:55 +0100)
committerJohann Klähn <johann@jklaehn.de>
Wed, 3 Feb 2021 21:55:17 +0000 (22:55 +0100)
Copyright-paperwork-exempt: yes

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

index 9edcff0ea15d35edf16d2b53a6c31641533e97b3..72e080001b2a474ebd0c707c09ecc8dbec6837d8 100644 (file)
@@ -1397,17 +1397,18 @@ no keyword implies `:all'."
 (defun use-package-handler/:custom (name _keyword args rest state)
   "Generate use-package custom keyword code."
   (use-package-concat
-   (mapcar
-    #'(lambda (def)
-        (let ((variable (nth 0 def))
-              (value (nth 1 def))
-              (comment (nth 2 def)))
-          (unless (and comment (stringp comment))
-            (setq comment (format "Customized with use-package %s" name)))
-          `(let ((custom--inhibit-theme-enable nil))
-             (custom-theme-set-variables 'use-package
-                                        '(,variable ,value nil () ,comment)))))
-    args)
+   `((let ((custom--inhibit-theme-enable nil))
+       (custom-theme-set-variables
+        'use-package
+        ,@(mapcar
+           #'(lambda (def)
+               (let ((variable (nth 0 def))
+                     (value (nth 1 def))
+                     (comment (nth 2 def)))
+                 (unless (and comment (stringp comment))
+                   (setq comment (format "Customized with use-package %s" name)))
+                 `'(,variable ,value nil () ,comment)))
+           args))))
    (use-package-process-keywords name rest state)))
 
 ;;;; :custom-face