diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2026-03-27 10:15:48 +0100 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2026-03-27 10:15:48 +0100 |
| commit | 4debc07b5a6fae055ec92939b63f86e2265a795a (patch) | |
| tree | f15ff287b583192dd2e1b5ec46d2b43b39f190ea /lisp/transient.el | |
| parent | 63f907237d248681c876eff59d624bff9c936876 (diff) | |
transient--wrap-command: Fix advising of native-compiled Lisp
Unlike its docstring, the info manual is outdated and falsely claims
that `subrp' only returns t for built-in functions, but it also does
so for native-compiled Lisp functions.
Having looked only at the info manual, I ended up using `subrp' in
the previous commit, [1: 63f90723], to test whether the command is a
"built-in function". What I was looking for is now called a primitive
and the respective predicate is called `subr-primitive-p'.
Closes #435.
Diffstat (limited to 'lisp/transient.el')
| -rw-r--r-- | lisp/transient.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/transient.el b/lisp/transient.el index c13cac2..63c02eb 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -3052,7 +3052,8 @@ value. Otherwise return CHILDREN as is.") (oset prefix unwind-suffix nil))))) (add-function :around (if (and (symbolp this-command) - (not (subrp (symbol-function this-command)))) + (not (subr-primitive-p + (symbol-function this-command)))) (symbol-function this-command) this-command) advice '((depth . -99))) @@ -3107,7 +3108,8 @@ value. Otherwise return CHILDREN as is.") (apply ',advice-body fn args))) (add-function :around (if (and (symbolp this-command) - (not (subrp (symbol-function this-command)))) + (not (subr-primitive-p + (symbol-function this-command)))) (symbol-function this-command) this-command) advice '((depth . -99)))))) |
