[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 6e741ee 4/5: Stop using oref-default to get d
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient 6e741ee 4/5: Stop using oref-default to get default value of object-allocated slot |
Date: |
Tue, 15 Jun 2021 19:03:14 -0400 (EDT) |
branch: externals/transient
commit 6e741ee2bd0774a9e9bf7fbaecca4878d67d6d3e
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
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".
---
lisp/transient.el | 8 +++++---
1 file 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)))