[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 9183fe1ed2 006/366: Do not use cl-typep, whic
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient 9183fe1ed2 006/366: Do not use cl-typep, which is broken for objects on Emacs 25 |
Date: |
Tue, 25 Jan 2022 18:54:21 -0500 (EST) |
branch: externals/transient
commit 9183fe1ed2688fe41db2a367896b5375dbba2cd9
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Do not use cl-typep, which is broken for objects on Emacs 25
The issue we are avoiding is that `cl-typep' returns nil when it
should return t, because the VAL does in fact derive from the class
TYPE.
To avoid this issue we have to resort to using `CLASS--eieio-childp'
predicates, which--as the name suggests--we are not supposed to use.
`cl-typep' only appears to be broken when using byte-compiled code
and some other factor also appears to play a role. I was not able
to reproduce this issue when using Borg instead of Package. On
Emacs 26 `cl-typep' works as expected (though because it has no
doc-string, we don't know whether the expectation changed between
those two Emacs releases).
Also don't use `cl-etypecase' when objects are involved because
that uses `cl-typep'.
Fixes https://github.com/magit/magit/issues/3732.
---
lisp/transient.el | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index c06f24fbfb..de02a9361e 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1000,7 +1000,7 @@ command; explicitly defined infix arguments continue to
polute
the command namespace. It would be better if all this were made
unnecessary by a `execute-extended-command-ignore' symbol property
but unfortunately that does not exist (yet?)."
- (if (cl-typep arg 'transient-suffix)
+ (if (transient-suffix--eieio-childp arg)
(let ((sym (oref arg command)))
(if (commandp sym)
sym
@@ -1274,12 +1274,14 @@ EDIT may be non-nil."
'transient--layout)))))))
(setq transient--suffixes
(cl-labels ((s (def)
- (cl-etypecase def
- (integer nil)
- (string nil)
- (list (cl-mapcan #'s def))
- (transient-group (cl-mapcan #'s (oref def suffixes)))
- (transient-suffix (list def)))))
+ (cond
+ ((integerp def) nil)
+ ((stringp def) nil)
+ ((listp def) (cl-mapcan #'s def))
+ ((transient-group--eieio-childp def)
+ (cl-mapcan #'s (oref def suffixes)))
+ ((transient-suffix--eieio-childp def)
+ (list def)))))
(cl-mapcan #'s transient--layout))))
(defun transient--init-child (levels spec)
@@ -1328,7 +1330,7 @@ EDIT may be non-nil."
(error "No key for %s" (oref obj command))))
(cl-defmethod transient--init-suffix-key ((obj transient-argument))
- (if (cl-typep obj 'transient-switches)
+ (if (transient-switches--eieio-childp obj)
(cl-call-next-method obj)
(unless (slot-boundp obj 'shortarg)
(when-let ((shortarg (transient--derive-shortarg (oref obj argument))))
@@ -1801,7 +1803,7 @@ For transients that are used to pass arguments to a
subprosess
separates non-positional arguments from positional arguments.
The value of Magit's file argument for example looks like this:
\(\"--\" file...)."
- (let ((val (if (and (cl-typep prefix 'transient-prefix))
+ (let ((val (if (and (transient-prefix--eieio-childp prefix))
(delq nil (mapcar 'transient-infix-value
transient--suffixes))
(and (or (not prefix)
- [elpa] branch externals/transient created (now 4477555b17), Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient dc37f6361b 002/366: manual: Revise, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 8219c0ba1d 003/366: read-from-minibuffer: Bugfix, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 33f538a0bb 001/366: Release version 0.1.0, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 44fa23c379 004/366: transient--pre-exit: Add debug statement, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 0758efa1db 015/366: transient--show: Remove trailing whitespace, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 9183fe1ed2 006/366: Do not use cl-typep, which is broken for objects on Emacs 25,
Jonas Bernoulli <=
- [elpa] externals/transient be13cd4616 008/366: readme: Fix screenshot url, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient ca18bb66d2 012/366: transient--show: Bind lv-use-separator to t, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 2f011c9f19 013/366: transient--show-brief: Don't call kbd twice per key, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient db815604b3 025/366: Mention that infixes are suffixes, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient cc54574005 017/366: manual: Prevent evaluation of code blocks, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 328298fb7d 021/366: transient--pp-to-file: New function, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 796f896507 026/366: Add a changelog, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 1fa3896986 016/366: manual: Call ox-texinfo+-update-copyright-years while exporting, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient f0213e0543 032/366: Add commands to scroll transient window, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 2fed1b4f90 036/366: Change transient-show's key binding, Jonas Bernoulli, 2022/01/25