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

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

[elpa] externals/leaf eb5aed9 01/18: Add custom type for leaf-defaults a


From: Stefan Monnier
Subject: [elpa] externals/leaf eb5aed9 01/18: Add custom type for leaf-defaults and change leaf-system-defaults to defvar
Date: Wed, 2 Jun 2021 18:28:00 -0400 (EDT)

branch: externals/leaf
commit eb5aed99bfc8a72f426c5f36585b0ad6b5ccb4f2
Author: USAMI Kenta <tadsan@zonu.me>
Commit: USAMI Kenta <tadsan@zonu.me>

    Add custom type for leaf-defaults and change leaf-system-defaults to defvar
    
    To avoid user confusion, the system default value
    `leaf-system-defaults` should be defined as a defvar rather than a
    custom variable.
    
    Since `leaf-defaults` is a variable for user customization, end users
    only need to change it.
    
    Maybe there are use cases where developers of extensions like
    leaf-keywords.el change `leaf-system-defaults`, so I've changed it to
    defvar instead of defconst.
---
 leaf.el | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/leaf.el b/leaf.el
index 3ef15dd..d92af84 100644
--- a/leaf.el
+++ b/leaf.el
@@ -361,15 +361,19 @@ Sort by `leaf-sort-leaf--values-plist' in this order.")
 
 (defcustom leaf-defaults '()
   "The value that are interpreted as specified for all `leaf' blocks."
-  :type 'sexp
+  :type '(plist :key-type (choice (const :leaf-autoload)
+                                  (const :leaf-defer)
+                                  (const :leaf-protect)
+                                  (const :leaf-defun)
+                                  (const :leaf-defvar)
+                                  (const :leaf-path))
+                :value-type boolean)
   :group 'leaf)
 
-(defcustom leaf-system-defaults (leaf-list
-                                 :leaf-autoload t :leaf-defer t :leaf-protect t
-                                 :leaf-defun t :leaf-defvar t :leaf-path t)
-  "The value for all `leaf' blocks for leaf system."
-  :type 'sexp
-  :group 'leaf)
+(defvar leaf-system-defaults (list
+                              :leaf-autoload t :leaf-defer t :leaf-protect t
+                              :leaf-defun t :leaf-defvar t :leaf-path t)
+  "The value for all `leaf' blocks for leaf system.")
 
 (defcustom leaf-defer-keywords (list
                                 :bind :bind*



reply via email to

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