Skip to content

Commit

Permalink
transient-active-prefix: Accept symbol or list of symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmturner authored and tarsius committed Sep 11, 2024
1 parent 6b62e6c commit 5a41cd5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# -*- mode: org -*-
* v0.7.6 UNRELEASED

- ~transient-active-prefix~ now accepts a single prefix symbol, in place
of a list of such symbols. #307

* v0.7.5 2024-09-01

- Updated tooling.
Expand Down
6 changes: 3 additions & 3 deletions docs/transient.org
Original file line number Diff line number Diff line change
Expand Up @@ -1308,9 +1308,9 @@ function, which for infix arguments serves about the same purpose as
is current, this function is also suitable for use in asynchronous
code, such as timers and callbacks (this function's main use-case).

If optional PREFIXES is non-~nil~, it must be a list of prefix command
symbols, in which case the active transient object is only returned
if it matches one of the PREFIXES.
If optional PREFIXES is non-~nil~, it must be a prefix command symbol
or a list of symbols, in which case the active transient object is
only returned if it matches one of the PREFIXES.

** Transient State
#+cindex: transient state
Expand Down
6 changes: 3 additions & 3 deletions docs/transient.texi
Original file line number Diff line number Diff line change
Expand Up @@ -1510,9 +1510,9 @@ that is run directly by a command that is invoked while a transient
is current, this function is also suitable for use in asynchronous
code, such as timers and callbacks (this function's main use-case).

If optional PREFIXES is non-@code{nil}, it must be a list of prefix command
symbols, in which case the active transient object is only returned
if it matches one of the PREFIXES@.
If optional PREFIXES is non-@code{nil}, it must be a prefix command symbol
or a list of symbols, in which case the active transient object is
only returned if it matches one of the PREFIXES@.
@end defun

@node Transient State
Expand Down
8 changes: 4 additions & 4 deletions lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -1593,13 +1593,13 @@ that is run directly by a command that is invoked while a transient
is current, this function is also suitable for use in asynchronous
code, such as timers and callbacks (this function's main use-case).
If optional PREFIXES is non-nil, it must be a list of prefix command
symbols, in which case the active transient object is only returned
if it matches one of the PREFIXES."
If optional PREFIXES is non-nil, it must be a prefix command symbol
or a list of symbols, in which case the active transient object is
only returned if it matches one of PREFIXES."
(and transient--showp
transient--prefix
(or (not prefixes)
(memq (oref transient--prefix command) prefixes))
(memq (oref transient--prefix command) (ensure-list prefixes)))
(or (memq 'transient--pre-command pre-command-hook)
(and (memq t pre-command-hook)
(memq 'transient--pre-command
Expand Down

0 comments on commit 5a41cd5

Please sign in to comment.