summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-01-24[dump]oclosureJonas Bernoulli
2024-01-21Use a dedicated symbol to hide from read-extended-commandJonas Bernoulli
By using a dedicated symbol, which uses our package prefix, we ensure that we can set `read-extended-command-predicate', without affecting any unrelated package. `transient-command-completion-not-suffix-only-p' only prevents "anonymously defined" transient suffix commands from being offered as `read-extended-command' completion candidates. Furthermore, because we only set `read-extended-command-predicate' iff it is non-nil, this does not mess with any user customization of this option. Also note that if the user uses `command-completion-default-include-p' instead, then the suffix-only commands are also filtered out. IMO it is reasonable for a package to use this feature to declare that certain commands should absolutely never be offered as completion candidates. The interface of this feature is not optimized for this use-case, but I predict that `read-extended-command-predicate' will one day be a hook, at which point I would not have to write this explanation in the hope that it convincingly makes the case for why daring to us it to achieve the goal that it was designed to achieve is not Wrong™, not even if it is a library that does it, as opposed to a user. It has been suggested that Transient should instead avoid `intern'ing any symbols for these (admittedly not fully) anonymous suffix commands. The proposed patch does not actually work, because these symbols *have to be* interned, and for backward compatibility reasons `transient--init-suffix' ensures that they are. So initially (at load-time) these suffix command symbols would not be interned but as the user invokes transient commands, more and more of them would become interned. We could avoid interning anonymously defined suffix commands altogether, but that would have unfortunate consequences. In fact Transient used to do that because `read-extended-command-predicate' did not exist yet. But I sure wished it did, and I was considering implementing something like that myself. So of course once that feature appear, I was happy to take advantage, in [1: 226db67b]. Going back to not binding every suffix command to an interned symbol, would complicate matters considerably. It would lead to bugs, and would slow down development, because I would constantly have to double check changes, to reduce the risk of introducing such bugs. The code would be more difficult to understand. Frankly, doing so would mean intentionally adding accidental complexity. I very much want to avoid that oxymoron. Furthermore, not interning anonymously defined suffixes, would do nothing to hide infix arguments that are explicitly defined using `transient-define-infix', but those should also not be offered as completion candidates. The approach I have chosen does. Instead of #273. 1: 2023-08-12 226db67b3680acbeb74cb0403e1a302917054174 All suffix commands now must be accessed through fbound symbols
2024-01-21Hide suffix-only commands from read-extended-commandJonas Bernoulli
2024-01-21Use completion-predicate symbol property instead of command-modesJonas Bernoulli
It is a more natural fit but didn't exist yet when I first learned about this feature. Both properties were introduced in Emacs 28.1.
2024-01-21transient--wrap-command: Bind debuggerJonas Bernoulli
Without this the transient window would not be deleted when the debugger is entered.
2024-01-21transient--wrap-command: ReindentJonas Bernoulli
Do this in a separate commit because the diff sure looks like much more changed than just some whitespace.
2024-01-21transient--parse-suffix: Avoid overly long symbol namesJonas Bernoulli
We already fall back to making the suffix's key part of the name of the command, when its description is a lambda. Do the same if it is a named function, and if it is a string, then only use it if it is less than 16 characters long. (As a side-note, using the description has the advantage that more meaningful symbols appear in backtraces. While falling back to using the key, is less meaningful (and users may change the key, leading to a mismatch), it is still much more useful than using `gensym'.)
2024-01-21Add signage to emergency exitsJonas Bernoulli
2024-01-20transient--make-predicate-map: Fix detecting outer prefixJonas Bernoulli
Since [1: 5f2cfc9f] we try to detect whether there is an outer prefix, that non-transient suffixes could return to, by checking if `transient--current-prefix' is non-nil. That works then the prefix is created, but that variable is also always non-nil after a transient suffix is invoked. Instead check if `transient--stack' is non-nil. 1: 2023-11-29 5f2cfc9f73e756fb337df70909fcd3d0bce56911 transient--make-predicate-map: Only return if there is a parent
2024-01-14transient--get-face: Make suffix object available to face functionJonas Bernoulli
2024-01-14transient-define-suffix: Fall back to class's default commandJonas Bernoulli
2024-01-14transient-suffix-object: Return transient--pending-suffix if non-nilJonas Bernoulli
2024-01-13transient-infix-read: Signal error if called with non-suffix symbolJonas Bernoulli
Previously this resulted in an `excessive-lisp-nesting' error.
2024-01-06Fix typosJonas Bernoulli
2024-01-05transient--delete-window: Get transient buffer by nameJonas Bernoulli
We try to dedicate the transient window to the transient buffer, but that does not actually guarantee that it is not used to displayed another buffer. Normally displaying another buffer in this window would be fatal, but if it happens when displaying the *Help* buffer, then that works out okay, as long as we avoid immediately killing that buffer again. Closes #271.
2024-01-01Bump copyright yearsJonas Bernoulli
2023-12-17make: Add redo targetJonas Bernoulli
2023-12-16Release version 0.5.3v0.5.3Jonas Bernoulli
2023-12-16transient--insert-group(columns): Bind transient--pending-groupJonas Bernoulli
Bind it to the column group for which a suffix is currently being inserted. Fixes #269.
2023-12-09make: Remove obsolete org-export kludgeJonas Bernoulli
2023-12-05Release version 0.5.2v0.5.2Jonas Bernoulli
2023-12-05docs: Fix typoJonas Bernoulli
2023-12-05docs: Replace all unicode quotes in texi exportJonas Bernoulli
2023-12-05Release version 0.5.1v0.5.1Jonas Bernoulli
2023-12-05docs: Add new contributed introductionJ.D. Smith
This introduction by JD Smith was first published on the wiki [1][2]. At popular demand, we now use it as the official introduction. [1]: https://github.com/magit/transient/wiki [2]: https://github.com/magit/transient.wiki.git Co-authored-by: Jonas Bernoulli <jonas@bernoul.li> Some light editorial work.
2023-12-05docs: Relegate the old introduction and introduce the term "menu"Jonas Bernoulli
2023-12-04Backport commit 7705bdfa5b8 from EmacsJonas Bernoulli
2023-12-04Update changelogJonas Bernoulli
2023-12-04Inform users if they have to manually upgrade seqJonas Bernoulli
2023-12-04Remove unnecessary variable declarationJonas Bernoulli
We now require at least Emacs 26.1.
2023-12-04Remove unnecessary nesting from some face definitionsJonas Bernoulli
2023-12-04transient-higher-level: Ensure box color is validJonas Bernoulli
2023-12-03Define box line-width more carefullyJonas Bernoulli
Before Emacs 28, the value had to be a number. In Emacs 30 it can be a cons-cell of two numbers, but the manual says that it can still be a number. But that doesn't seem to work for all Emacs releases in between, at least not when using a negative number. Try to cater to the preferences of various Emacs releases.
2023-12-01transient-toggle-level-limit: Use transient-prefix-objectJonas Bernoulli
Since this is the only use of `transient-define-suffix' in "transient.el" itself, it might be looked at for inspiration, so use `transient-prefix-object', instead of `transient--prefix', which in this case would be equivalent, but is intended for internal use only. Hopefully this helps avoiding some confusion.
2023-12-01transient-{set,save,reset}: Use transient-prefix-objectJonas Bernoulli
2023-11-29transient--make-predicate-map: Only return if there is a parentJonas Bernoulli
Only prepare to return to the parent transient if there actually is a parent. The only negative effect of failing to do this was that the suffix was colored wrong, since `transient--do-return' falls back to behave like `transient--do-exit'.
2023-11-28Release version 0.5.0v0.5.0Jonas Bernoulli
2023-11-28Bump Compat dependencyJonas Bernoulli
2023-11-28manual: Update pre-command documentationJonas Bernoulli
2023-11-27transient-mode-line-format: Support specifying separator thicknessJonas Bernoulli
2023-11-27Fix color lookup for non-suffixesJonas Bernoulli
There actually is a binding for [nil], in `transient--predicate-map', and it's not always what we need when determining the color (and thus pre-command) for non-suffixes (via `transient--separator-line').
2023-11-27transient--get-pre-command: Remove pointless ignore-errorsJonas Bernoulli
2023-11-27Compact the otherwise clause of cond where possibleJonas Bernoulli
2023-11-27transient--default-infix-command: Add fallback docstringJonas Bernoulli
Remove `transient--anonymous-infix-argument', which was originally used for the same purpose, but was dead code since [1: 226db67b]. 1: 2023-08-12 226db67b3680acbeb74cb0403e1a302917054174 All suffix commands now must be accessed through fbound symbols
2023-11-27transient-key-{stay,noop,return,exit}: Complete docstringsJonas Bernoulli
2023-11-27transient-format-key(around:suffix): Add docstringJonas Bernoulli
2023-11-27Use static-if to pick an implementation of transient--wrap-commandJonas Bernoulli
2023-11-27transient-format(around:suffix): Fix detection of minibuffer usageJonas Bernoulli
2023-11-26transient-format: Only highlight infix if minibuffer is usedJonas Bernoulli
Without this, toggling an *option* off (i.e., without using the minibuffer) causes the use of `transient-active-infix' to stick around.
2023-11-26Improve looks of debugging facesJonas Bernoulli
Most importantly give them distinct looks, and use colors appropriate to the severity of the potential issue. I.e., mismatched keys should be avoided if at all possible, while adding a shorthand-like binding for an argument that doesn't exist as a shorthand, cannot be avoided, and hiding come suffixes from users is also something that is often done intentionally.