[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient a6295fa7ee 042/366: Declare that prefix and s
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient a6295fa7ee 042/366: Declare that prefix and suffix commands are for interactive use only |
Date: |
Tue, 25 Jan 2022 18:54:25 -0500 (EST) |
branch: externals/transient
commit a6295fa7eea2d7a95c705684064e82ea47e27e44
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Declare that prefix and suffix commands are for interactive use only
I intended to do this for a long time but never got around to do it.
In all of Magit there were only four cases where a suffix command
was called non-interactively. One of them was a bug, another a very
special case where the command calls itself non-interactively (now
inside `with-no-warnings') and only two cases where we now have to
add a tiny bit of duplication to avoid the non-interactive calls.
I think that means calling suffix commands non-interactively is not
something that is useful often in general. If those very few cases
were calling non-interactively is legitimate `with-no-warning' or
maybe an explicit "(put SUFFIX 'interactive-only nil)" after the
suffix definition should be good enough.
For prefix commands I think it is simply always wrong to call them
non-interactively.
---
lisp/transient.el | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lisp/transient.el b/lisp/transient.el
index ea68131151..1bd23350c5 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -596,6 +596,7 @@ to the setup function:
`(lambda ()
(interactive)
(transient-setup ',name))))
+ (put ',name 'interactive-only t)
(put ',name 'function-documentation ,docstr)
(put ',name 'transient--prefix
(,(or class 'transient-prefix) :command ',name ,@slots))
@@ -632,6 +633,7 @@ just like for `prefix-arg' and `current-prefix-arg'.
(transient--expand-define-args args)))
`(progn
(defalias ',name (lambda ,arglist ,@body))
+ (put ',name 'interactive-only t)
(put ',name 'function-documentation ,docstr)
(put ',name 'transient--suffix
(,(or class 'transient-suffix) :command ',name ,@slots)))))
@@ -678,6 +680,7 @@ keyword.
(transient--expand-define-args args)))
`(progn
(defalias ',name ,(transient--default-infix-command))
+ (put ',name 'interactive-only t)
(put ',name 'function-documentation ,docstr)
(put ',name 'transient--suffix
(,(or class 'transient-switch) :command ',name ,@slots)))))
- [elpa] externals/transient e889030b0f 027/366: Quote a parenthesis in a doc-string, (continued)
- [elpa] externals/transient e889030b0f 027/366: Quote a parenthesis in a doc-string, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 2033ac1ed9 031/366: transient-mode-line-format: New option, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 08b4778890 033/366: Make it trivial to use "q" to quit again, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 9429cb628a 035/366: transient-scroll-down: Fix pasto, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 7e45a57ec8 030/366: No longer depend on lv to display the transient buffer, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 625683c9ea 029/366: transient--pre-exit: Don't reselect original window, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient a2dada29c8 034/366: manual: Add a FAQ, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient a2222d294c 038/366: transient-base-map: New parent of other shared keymaps, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient b1da0cab5d 040/366: Remove my personal key bindings, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient bbf81297c6 041/366: Prevent infix commands from being added to command-history, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient a6295fa7ee 042/366: Declare that prefix and suffix commands are for interactive use only,
Jonas Bernoulli <=
- [elpa] externals/transient 2872b4a661 045/366: transient-init-value: Define for transient-prefix, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient a47ae9499b 049/366: transient-{set, save}: Support exiting the transient, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 9e30038d2d 051/366: transient-set-level: Limit when it is called, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 544b3bb864 057/366: Support automatically disabling incompatible arguments, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 28aac32e82 058/366: Fix previous commit, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 4f7ee36899 060/366: transient-infix-set: Bugfixes, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 7a7c3e15b6 065/366: transient-show-popup: Support even suppressing one-line summary, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient d7a1e81440 067/366: transient-show-popup: Update documentation, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 5a360bb206 090/366: Remove conflicting suffix when inserting new suffix, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 4ce1868e62 091/366: Fix replacing a suffix with another suffix bound to same key, Jonas Bernoulli, 2022/01/25