[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient a3e536333e 189/366: Support anonymous non-inf
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient a3e536333e 189/366: Support anonymous non-infix suffixes |
Date: |
Tue, 25 Jan 2022 18:54:40 -0500 (EST) |
branch: externals/transient
commit a3e536333eef87d4af7b0a2a65f08f40837619b5
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Support anonymous non-infix suffixes
---
docs/transient.org | 20 ++++++++++++++------
docs/transient.texi | 20 ++++++++++++++------
lisp/transient.el | 9 +++++++++
3 files changed, 37 insertions(+), 12 deletions(-)
diff --git a/docs/transient.org b/docs/transient.org
index ff08372ec0..cf55360ff8 100644
--- a/docs/transient.org
+++ b/docs/transient.org
@@ -8,7 +8,7 @@
#+TEXINFO_DIR_CATEGORY: Emacs
#+TEXINFO_DIR_TITLE: Transient: (transient).
#+TEXINFO_DIR_DESC: Transient Commands
-#+SUBTITLE: for version 0.2.0 (v0.2.0-36-g96cec8e1+1)
+#+SUBTITLE: for version 0.2.0 (v0.2.0-37-gf2252d53+1)
#+TEXINFO_DEFFN: t
#+OPTIONS: H:4 num:4 toc:2
@@ -37,7 +37,7 @@ Calling a suffix command usually causes the transient to be
exited
but suffix commands can also be configured to not exit the transient.
#+TEXINFO: @noindent
-This manual is for Transient version 0.2.0 (v0.2.0-36-g96cec8e1+1).
+This manual is for Transient version 0.2.0 (v0.2.0-37-gf2252d53+1).
#+BEGIN_QUOTE
Copyright (C) 2018-2020 Jonas Bernoulli <jonas@bernoul.li>
@@ -894,10 +894,18 @@ the object's values just for the binding inside this
transient.
The next element is either a command or an argument. This is the only
argument that is mandatory in all cases.
-- COMMAND is a symbol that is bound as a function, which has to be a
- command. Any command will do; it does not need to have an object
- associated with it (as would be the case if ~transient-define-suffix~
- or ~transient-define-infix~ were used to define it).
+- Usually COMMAND is a symbol that is bound as a function, which has
+ to be defined or at least autoloaded as a command by the time the
+ containing prefix command is invoked.
+
+ Any command will do; it does not need to have an object associated
+ with it (as would be the case if ~transient-define-suffix~ or
+ ~transient-define-infix~ were used to define it).
+
+ The command can also be a closure or lambda expression, but that
+ should only be used for dynamic transients whose suffixes are
+ defined when the prefix command is invoked. See information about
+ the ~:setup-children~ function in [[*Group Specifications]].
As mentioned above, the object that is associated with a command can
be used to set the default for certain values that otherwise have to
diff --git a/docs/transient.texi b/docs/transient.texi
index f7dcae2d0d..7eaecfdfe9 100644
--- a/docs/transient.texi
+++ b/docs/transient.texi
@@ -31,7 +31,7 @@ General Public License for more details.
@finalout
@titlepage
@title Transient User and Developer Manual
-@subtitle for version 0.2.0 (v0.2.0-36-g96cec8e1+1)
+@subtitle for version 0.2.0 (v0.2.0-37-gf2252d53+1)
@author Jonas Bernoulli
@page
@vskip 0pt plus 1filll
@@ -65,7 +65,7 @@ Calling a suffix command usually causes the transient to be
exited
but suffix commands can also be configured to not exit the transient.
@noindent
-This manual is for Transient version 0.2.0 (v0.2.0-36-g96cec8e1+1).
+This manual is for Transient version 0.2.0 (v0.2.0-37-gf2252d53+1).
@quotation
Copyright (C) 2018-2020 Jonas Bernoulli <jonas@@bernoul.li>
@@ -1134,10 +1134,18 @@ argument that is mandatory in all cases.
@itemize
@item
-COMMAND is a symbol that is bound as a function, which has to be a
-command. Any command will do; it does not need to have an object
-associated with it (as would be the case if @code{transient-define-suffix}
-or @code{transient-define-infix} were used to define it).
+Usually COMMAND is a symbol that is bound as a function, which has
+to be defined or at least autoloaded as a command by the time the
+containing prefix command is invoked.
+
+Any command will do; it does not need to have an object associated
+with it (as would be the case if @code{transient-define-suffix} or
+@code{transient-define-infix} were used to define it).
+
+The command can also be a closure or lambda expression, but that
+should only be used for dynamic transients whose suffixes are
+defined when the prefix command is invoked. See information about
+the @code{:setup-children} function in @ref{Group Specifications}.
As mentioned above, the object that is associated with a command can
be used to set the default for certain values that otherwise have to
diff --git a/lisp/transient.el b/lisp/transient.el
index 1945f5937e..758a3daaf0 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -945,6 +945,15 @@ example, sets a variable use `transient-define-infix'
instead.
(error "Need command, got %S" car))
((symbolp car)
(setq args (plist-put args :command pop)))
+ ((and (commandp car)
+ (not (stringp car)))
+ (let ((cmd pop)
+ (sym (intern (format "transient:%s:%s"
+ prefix
+ (or (plist-get args :description)
+ (plist-get args :key))))))
+ (defalias sym cmd)
+ (setq args (plist-put args :command sym))))
((or (stringp car)
(and car (listp car)))
(let ((arg pop))
- [elpa] externals/transient e90f7a165e 335/366: Add support for returning from a sub-prefix to the parent prefix, (continued)
- [elpa] externals/transient e90f7a165e 335/366: Add support for returning from a sub-prefix to the parent prefix, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 8b1f8dcc51 354/366: transient--minibuffer-depth: Must always be a number, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 5762bd9a06 341/366: transient-hide-during-minibuffer-read: New option, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient de5a325616 349/366: Re-align debug declarations, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 6103f168aa 347/366: transient--describe-function: Deal with anonymous infix arguments, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 4477555b17 366/366: transient--post-exit: Deal with unbound transient slot properly, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient ad7f255308 116/366: For popups set tab-line-format to nil, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 0ad64ddc5d 010/366: transient-remove-suffix: Fix removal of last child of a group, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient f2ef69cfcc 176/366: transient--get-predicate-for: New function, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient f2252d53b6 188/366: Support delaying setup of suffixes until prefix invocation, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient a3e536333e 189/366: Support anonymous non-infix suffixes,
Jonas Bernoulli <=
- [elpa] externals/transient aaac13bb9d 193/366: transient--make-transient-map: Don't explicitly take emergency exit, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 313eee0f1c 196/366: manual: Document more infix slots, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 1b9929eca9 197/366: Add new `unsavable' infix slot, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 8b22b52b83 211/366: Support defining a per-prefix fallback suffix description function, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 7065e1ce86 229/366: manual: Various small improvements, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 030d0fe56b 251/366: Rearrange library header, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 779b847c20 252/366: make: Update path to ox-extra, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient eb28c513a8 253/366: Release version 0.3.3, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 6e741ee2bd 260/366: Stop using oref-default to get default value of object-allocated slot, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 90a0562200 265/366: transient-highlight-higher-levels: New option, Jonas Bernoulli, 2022/01/25