-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add --exclude option #19
Conversation
Thanks to transient, the following useful features are also supported: - repeated `--exclude` options E.g. entering `--exclude=a,b` in the minibuffer will result in `--exclude=a --exclude=b` being passed to the test command - The value(s) can be temporarily saved by `C-x s` to avoid having to type them in every time
Sorry about the late reply. I haven't looked into the details, is there any way we can make a transient definition user configurable? |
I'm not too familiar with how transient works and I'm not sure what kind of configurability you are suggesting. If you tell me what kind of user customisation you'd like to see, I could investigate whether it is possible. |
Let's take the current example, you are proposing to add |
Cool, I’ll see if this can be done with transient. |
@ananthakumaran So, there are a couple of options of how to implement this which I got from this discussion on reddit
A patch would look like this: diff --git a/exunit.el b/exunit.el
index 1b61c4d..009b66b 100644
--- a/exunit.el
+++ b/exunit.el
@@ -39,12 +39,18 @@
;;; Private
+(defcustom exunit-transient-extra-flags '(--exclude)
+ "Controls the extra flags available in the transient interface"
+ :type '(repeat string)
+ :group 'exunit)
+
(transient-define-infix exunit-transient:--exclude ()
:description "Exclude"
:class 'transient-option
:multi-value 'repeat
:shortarg "-e"
- :argument "--exclude=")
+ :argument "--exclude="
+ :if (lambda () (memq '--exclude exunit-transient-extra-flags)))
(transient-define-prefix exunit-transient ()
"ExUnit"
The patch would look something like this: diff --git a/exunit.el b/exunit.el
index 1b61c4d..28eb059 100644
--- a/exunit.el
+++ b/exunit.el
@@ -53,7 +53,7 @@
("-s" "Stale" "--stale")
("-t" "Trace" "--trace")
("-c" "Coverage" "--cover")
- (exunit-transient:--exclude)]
+ (exunit-transient:--exclude :level 5)]
[("-z" "Slowest" "--slowest=10")
("-m" "Fail Fast" "--max-failures=1")]]
["Actions"
I'm not that familiar with this part of transient, and I'm not sure how familiar most users are with it either. |
Thanks for checking, I am leading towards using level since that seems to be designed to solve this exact issue. I understand there is a discoverability issue, but we could put a note about the transient level. Let me know what you think. If you agree go ahead and update the PR, I will test it. |
I went ahead and implemented the change using the "levels" functionality. I added a note in the readme that shows users how to make the extra |
I often need to use the
--exclude
option. This PR adds support for it.Thanks to transient, it also supports supplying multiple
--exclude
options and the values supplied can even be saved for later invocations bytransient-set
usually bound toC-x s
(See Saving Values).