[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 6842305e84 286/366: Support undefined suffixe
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient 6842305e84 286/366: Support undefined suffixes if an extra step is taken |
Date: |
Tue, 25 Jan 2022 18:54:48 -0500 (EST) |
branch: externals/transient
commit 6842305e848b3a0edc955db7ebb9ac3557d38c7d
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Support undefined suffixes if an extra step is taken
See #61 and https://github.com/emacs-evil/evil-collection/issues/543.
---
docs/transient.org | 16 ++++++++++++++--
docs/transient.texi | 16 ++++++++++++++--
lisp/transient.el | 3 ++-
3 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/docs/transient.org b/docs/transient.org
index f164454189..dd7c2970db 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.3.6 (v0.3.6-16-gf5e600d3+1)
+#+SUBTITLE: for version 0.3.6 (v0.3.6-17-g2281d952+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.3.6 (v0.3.6-16-gf5e600d3+1).
+This manual is for Transient version 0.3.6 (v0.3.6-17-g2281d952+1).
#+BEGIN_QUOTE
Copyright (C) 2018-2021 Jonas Bernoulli <jonas@bernoul.li>
@@ -938,6 +938,18 @@ argument that is mandatory in all cases.
be set in the suffix specification. Therefore if there is no object,
then you have to make sure to specify the KEY and the DESCRIPTION.
+ As a special case, if you want to add a command that might be neither
+ defined nor autoloaded, you can use a workaround like:
+
+ #+BEGIN_SRC emacs-lisp
+ (transient-insert-suffix 'some-prefix "k"
+ '("!" "Ceci n'est pas une commande" no-command
+ :if (lambda () (featurep 'no-library))))
+ #+END_SRC
+
+ Instead of ~featurep~ you could also use ~require~ with a non-nil value
+ for NOERROR.
+
- The mandatory argument can also be a command-line argument, a
string. In that case an anonymous command is defined and bound.
diff --git a/docs/transient.texi b/docs/transient.texi
index a852cd01df..6cf8e6a94f 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.3.6 (v0.3.6-16-gf5e600d3+1)
+@subtitle for version 0.3.6 (v0.3.6-17-g2281d952+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.3.6 (v0.3.6-16-gf5e600d3+1).
+This manual is for Transient version 0.3.6 (v0.3.6-17-g2281d952+1).
@quotation
Copyright (C) 2018-2021 Jonas Bernoulli <jonas@@bernoul.li>
@@ -1184,6 +1184,18 @@ be used to set the default for certain values that
otherwise have to
be set in the suffix specification. Therefore if there is no object,
then you have to make sure to specify the KEY and the DESCRIPTION@.
+As a special case, if you want to add a command that might be neither
+defined nor autoloaded, you can use a workaround like:
+
+@lisp
+(transient-insert-suffix 'some-prefix "k"
+ '("!" "Ceci n'est pas une commande" no-command
+ :if (lambda () (featurep 'no-library))))
+@end lisp
+
+Instead of @code{featurep} you could also use @code{require} with a non-nil
value
+for NOERROR@.
+
@item
The mandatory argument can also be a command-line argument, a
diff --git a/lisp/transient.el b/lisp/transient.el
index ac718ba850..c939589fa2 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1074,7 +1074,8 @@ example, sets a variable use `transient-define-infix'
instead.
(put cmd 'transient--infix-command
(transient--default-infix-command))
;; This is not an anonymous infix argument.
- (error "Suffix %s is not defined or autoloaded as a command" cmd)))))
+ (when (transient--use-suffix-p obj)
+ (error "Suffix %s is not defined or autoloaded as a command"
cmd))))))
(defun transient--derive-shortarg (arg)
(save-match-data
- [elpa] externals/transient 4da0fab7d9 246/366: Release version 0.3.1, (continued)
- [elpa] externals/transient 4da0fab7d9 246/366: Release version 0.3.1, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient c145229a89 247/366: Add missing argument to user-error, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient a96818c93a 257/366: transient-display-buffer-action: Correct outdated doc-string, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient ef921d3048 258/366: transient--post-command: Deal with mystery quits, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient a9bdd013f9 259/366: transient-show-help: Use manpage of subprefixes, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 37684a8cf7 263/366: manual: use ox-texinfo's notoc support, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient cf5e58a3a7 267/366: make: Automatically set date in changelog, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient b2b375e848 275/366: transient-show-help: Avoid this-original-command, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient df13feff33 289/366: Remove various duplicated words, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient ee8bdcfcee 290/366: Fix alias definition, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 6842305e84 286/366: Support undefined suffixes if an extra step is taken,
Jonas Bernoulli <=
- [elpa] externals/transient 0c2255a296 295/366: transient-get-value: Add an emergency exit, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 938b059192 297/366: transient--show: Set point after displaying window again, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 9b6a251f5c 300/366: transient-show-help: Avoid this-original-command, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 667488ebff 305/366: Extend multi-value support, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 202271f755 306/366: Resurrect transient-files class, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 4e8aa09b3f 309/366: transient-define-infix: Fix documentation, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient c26cbac574 316/366: transient-{init, set}-value: Use case-sensitive matching, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 338f7942a7 320/366: Various debug improvements, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 79c999d263 325/366: transient--post-exit: New function, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient e77d16dd02 322/366: transient--post-command: Avoid needlessly recreating redisplay map, Jonas Bernoulli, 2022/01/25