Skip to content
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 Unstable flag to transient #32

Merged
merged 3 commits into from
Jun 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ W => open eshell without executing

* Customize

- Because the help popup is built with transient, you can [[https://www.gnu.org/software/emacs//manual/html_node/transient/Saving-Values.html][set and save
your choices]] the same way you would with any other transient
dialog.
- By default, justl searches the executable named *just*, you can
change the /justl-executable/ variable to set any explicit path.
- You can also control the width of the RECIPE column in the justl
Expand Down
12 changes: 8 additions & 4 deletions justl.el
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,12 @@ and output of process."

(defun justl--get-recipies-with-desc (justfile)
"Return all the recipies in JUSTFILE with description."
(let* ((recipe-status (justl--exec-to-string-with-exit-code
(format "%s --justfile=%s --list --unsorted"
justl-executable justfile)))
(let* ((t-args (transient-args 'justl-help-popup))
(recipe-status (justl--exec-to-string-with-exit-code
(format "%s %s --justfile=%s --list --unsorted"
justl-executable
(string-join t-args " ")
justfile)))
(justl-status (nth 0 recipe-status))
(recipe-lines (split-string
(nth 1 recipe-status)
Expand Down Expand Up @@ -622,6 +625,7 @@ tweaked further by the user."
("-n" "Disable Highlight" "--no-highlight")
("-q" "Quiet" "--quiet")
("-v" "Verbose output" "--verbose")
("-u" "Unstable" "--unstable")
(justl--color)
]
["Actions"
Expand Down Expand Up @@ -705,7 +709,7 @@ tweaked further by the user."
(let* ((justfiles (justl--find-justfiles default-directory))
(entries (justl--get-recipies-with-desc justfiles)))
(when (not (eq justl--list-command-exit-code 0) )
(error "Just process exited with exit-code %s. Check justfile syntax"
(error "Just process exited with exit-code %s. Check justfile syntax"
justl--list-command-exit-code))
(justl--save-line)
(setq tabulated-list-entries (justl--tabulated-entries entries))
Expand Down
3 changes: 3 additions & 0 deletions test/justl-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
(should (equal
(justl--is-recipe-line-p "# Terraform plan")
nil))
(should (equal
(justl--is-recipe-line-p "!include lorem.just")
nil))
(should (equal
(justl--is-recipe-line-p "push version: (build-cmd version)")
t))
Expand Down