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

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

[elpa] externals/setup 9a67209 14/25: Always call custom-load-symbol bef


From: Stefan Monnier
Subject: [elpa] externals/setup 9a67209 14/25: Always call custom-load-symbol before customizing an option
Date: Wed, 14 Apr 2021 18:49:02 -0400 (EDT)

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

    Always call custom-load-symbol before customizing an option
---
 setup.el | 66 ++++++++++++++++++++++++++++++----------------------------------
 1 file changed, 31 insertions(+), 35 deletions(-)

diff --git a/setup.el b/setup.el
index db937a5..175c45c 100644
--- a/setup.el
+++ b/setup.el
@@ -330,41 +330,37 @@ the first FEATURE."
 
 (setup-define :option
   (lambda (name val)
-    (let (load-p)
-      (cond ((symbolp name) t)
-            ((eq (car-safe name) 'append)
-             (setq name (cadr name)
-                   val (let ((sym (gensym)))
-                         `(let ((,sym ,val)
-                                (list (funcall (or (get ',name 'custom-get)
-                                                   #'symbol-value)
-                                               ',name)))
-                            (if (member ,sym list)
-                                list
-                              (append list (list ,sym)))))
-                   load-p t))
-            ((eq (car-safe name) 'prepend)
-             (setq name (cadr name)
-                   val (let ((sym (gensym)))
-                         `(let ((,sym ,val)
-                                (list (funcall (or (get ',name 'custom-get)
-                                                   #'symbol-value)
-                                               ',name)))
-                            (if (member ,sym list)
-                                list
-                              (cons ,sym list))))
-                   load-p t))
-            ((eq (car-safe name) 'remove)
-             (setq name (cadr name)
-                   val `(remove ,name (funcall (or (get ',name 'custom-get)
-                                                   #'symbol-value)
-                                               ',name))
-                   load-p t))
-            ((error "Invalid option %S" name)))
-      (macroexp-progn
-       (append (and load-p `((custom-load-symbol ',name)))
-               `((customize-set-variable ',name ,val "Modified by `setup'")
-                 (custom-push-theme 'theme-value ',name 'user 'reset))))))
+    (cond ((symbolp name) t)
+          ((eq (car-safe name) 'append)
+           (setq name (cadr name)
+                 val (let ((sym (gensym)))
+                       `(let ((,sym ,val)
+                              (list (funcall (or (get ',name 'custom-get)
+                                                 #'symbol-value)
+                                             ',name)))
+                          (if (member ,sym list)
+                              list
+                            (append list (list ,sym)))))))
+          ((eq (car-safe name) 'prepend)
+           (setq name (cadr name)
+                 val (let ((sym (gensym)))
+                       `(let ((,sym ,val)
+                              (list (funcall (or (get ',name 'custom-get)
+                                                 #'symbol-value)
+                                             ',name)))
+                          (if (member ,sym list)
+                              list
+                            (cons ,sym list))))))
+          ((eq (car-safe name) 'remove)
+           (setq name (cadr name)
+                 val `(remove ,name (funcall (or (get ',name 'custom-get)
+                                                 #'symbol-value)
+                                             ',name))))
+          ((error "Invalid option %S" name)))
+    `(progn
+       (custom-load-symbol ',name)
+       (customize-set-variable ',name ,val "Modified by `setup'")
+       (custom-push-theme 'theme-value ',name 'user 'reset)))
   :documentation "Set the option NAME to VAL.
 NAME may be a symbol, or a cons-cell.  If NAME is a cons-cell, it
 will use the car value to modify the behaviour.  These forms are



reply via email to

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