diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2021-06-15 23:35:23 +0200 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2021-06-15 23:35:23 +0200 |
| commit | 6e741ee2bd0774a9e9bf7fbaecca4878d67d6d3e (patch) | |
| tree | 0609751fd72994b4c4a6539be4e7230bf8bc4944 | |
| parent | a9bdd013f90619614c7fbc163bbd825b218b9dbc (diff) | |
Stop using oref-default to get default value of object-allocated slot
Such usage of `oref-default' is going to be deprecated; it will be
focused on accessing class-allocated slots. Replace this obscure
usage with a constant `transient--default-child-level' to continue
signaling that all three uses refer to the same magic number 1,
which means "show always".
| -rw-r--r-- | lisp/transient.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/transient.el b/lisp/transient.el index 51f116b..988eea6 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -571,10 +571,12 @@ the prototype is stored in the clone's `prototype' slot.") ;;;; Suffix +(defconst transient--default-child-level 1) + (defclass transient-child () ((level :initarg :level - :initform 1 + :initform transient--default-child-level :documentation "Enable if level of prefix is equal or greater.") (if :initarg :if @@ -937,7 +939,7 @@ example, sets a variable use `transient-define-infix' instead. (if (eq k :class) (setq class pop) (setq args (plist-put args k pop))))) - (vector (or level (oref-default 'transient-child level)) + (vector (or level transient--default-child-level) (or class (if (vectorp car) 'transient-columns @@ -1008,7 +1010,7 @@ example, sets a variable use `transient-define-infix' instead. (unless (plist-get args :key) (when-let ((shortarg (plist-get args :shortarg))) (setq args (plist-put args :key shortarg)))) - (list (or level (oref-default 'transient-child level)) + (list (or level transient--default-child-level) (or class 'transient-suffix) args))) |
