summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/transient.org6
-rw-r--r--docs/transient.texi6
-rw-r--r--lisp/transient.el11
3 files changed, 16 insertions, 7 deletions
diff --git a/docs/transient.org b/docs/transient.org
index cfcf8b9..c32822c 100644
--- a/docs/transient.org
+++ b/docs/transient.org
@@ -864,8 +864,10 @@ that tree are not objects but have the form {{{codevar((LEVEL CLASS PLIST))}}},
they are never active at the same time, see [[*Predicate Slots]].
Unfortunately both false-positives and false-negatives are possible.
- To deal with the former use non-~nil~ {{{var(KEEP-OTHER.)}}} To deal with the
- latter remove the conflicting binding explicitly.
+ To deal with the former use non-~nil~ {{{var(KEEP-OTHER.)}}} The symbol ~always~
+ prevents the removal of a false-positive in some cases where other
+ non-~nil~ values would fail. To deal with false-negatives remove the
+ conflicting binding separately, using ~transient-remove-suffix~.
- Function: transient-replace-suffix prefix loc suffix ::
diff --git a/docs/transient.texi b/docs/transient.texi
index 4ecb592..80dc451 100644
--- a/docs/transient.texi
+++ b/docs/transient.texi
@@ -1019,8 +1019,10 @@ that multiple suffix commands can be bound to the same key, provided
they are never active at the same time, see @ref{Predicate Slots}.
Unfortunately both false-positives and false-negatives are possible.
-To deal with the former use non-@code{nil} @var{KEEP-OTHER@.} To deal with the
-latter remove the conflicting binding explicitly.
+To deal with the former use non-@code{nil} @var{KEEP-OTHER@.} The symbol @code{always}
+prevents the removal of a false-positive in some cases where other
+non-@code{nil} values would fail. To deal with false-negatives remove the
+conflicting binding separately, using @code{transient-remove-suffix}.
@end defun
@defun transient-replace-suffix prefix loc suffix
diff --git a/lisp/transient.el b/lisp/transient.el
index 4ceef83..d368c8b 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1459,7 +1459,8 @@ Intended for use in a group's `:setup-children' function."
suffix prefix loc
"suffixes and groups cannot be siblings"))
(t
- (when-let* ((bindingp (listp suf))
+ (when-let* (((not (eq keep-other 'always)))
+ (bindingp (listp suf))
(key (transient--spec-key suf))
(conflict (car (transient--layout-member key prefix)))
(conflictp
@@ -1487,7 +1488,9 @@ LOC is a command, a key vector, a key description (a string
as returned by `key-description'), or a coordination list
(whose last element may also be a command or key).
Remove a conflicting binding unless optional KEEP-OTHER is
- non-nil.
+ non-nil. When the conflict appears to be a false-positive,
+ non-nil KEEP-OTHER may be ignored, which can be prevented
+ by using `always'.
See info node `(transient)Modifying Existing Transients'."
(declare (indent defun))
(transient--insert-suffix prefix loc suffix 'insert keep-other))
@@ -1502,7 +1505,9 @@ LOC is a command, a key vector, a key description (a string
as returned by `key-description'), or a coordination list
(whose last element may also be a command or key).
Remove a conflicting binding unless optional KEEP-OTHER is
- non-nil.
+ non-nil. When the conflict appears to be a false-positive,
+ non-nil KEEP-OTHER may be ignored, which can be prevented
+ by using `always'.
See info node `(transient)Modifying Existing Transients'."
(declare (indent defun))
(transient--insert-suffix prefix loc suffix 'append keep-other))