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

Prepare for v10 release #26

Merged
merged 3 commits into from
Sep 3, 2022
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 Changelog.org
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
* 0.10

- Integrate compilation mode for ~justl-exec-recipe-in-dir~
- Implement new logic for refreshing justl buffer. This improves UX
when there is a syntax issue with justfile. Fixes [[https://github.com/psibi/justl.el/issues/23][issue 23]].
- Improve usage documentation.

* 0.9

Expand Down
2 changes: 1 addition & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ the directory where the justfile is present should be enough.
Alternatively if you want to just execute a recipe quickly, call

#+begin_example elisp
M-x justl-execute-recipe-in-dir
M-x justl-exec-recipe-in-dir
#+end_example

* Shortcuts
Expand Down
23 changes: 18 additions & 5 deletions justl.el
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
;; USA

;; Version: 0.9
;; Version: 0.10
;; Author: Sibi Prabakaran
;; Keywords: just justfile tools processes
;; URL: https://github.com/psibi/justl.el
Expand All @@ -39,7 +39,7 @@
;;
;; Alternatively, if you want to just execute a recipe, call
;;
;; M-x justl-execute-recipe-in-dir
;; M-x justl-exec-recipe-in-dir
;;
;; Shortcuts:
;;
Expand Down Expand Up @@ -508,7 +508,7 @@ and output of process."

(defvar justl-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "g") 'justl)
(define-key map (kbd "g") 'justl--refresh-buffer)
(define-key map (kbd "e") 'justl-exec-recipe)
(define-key map (kbd "E") 'justl-exec-eshell)
(define-key map (kbd "?") 'justl-help-popup)
Expand Down Expand Up @@ -691,6 +691,20 @@ tweaked further by the user."
(goto-char (point-min))
(forward-line (1- justl--line-number))))

(defun justl--refresh-buffer ()
"Refresh justl buffer."
(interactive)
(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"
justl--list-command-exit-code))
(justl--save-line)
(setq tabulated-list-entries (justl--tabulated-entries entries))
(tabulated-list-print t)
(justl--jump-back-to-line)
(message "justl-mode: Refreshed")))

;;;###autoload
(defun justl ()
"Invoke the justl buffer."
Expand Down Expand Up @@ -720,8 +734,7 @@ tweaked further by the user."
(tabulated-list-init-header)
(tabulated-list-print t)
(hl-line-mode 1)
(message (concat "Just: " (f-dirname justfiles)))
(justl--jump-back-to-line))))
(message (concat "Just: " (f-dirname justfiles))))))

(provide 'justl)
;;; justl.el ends here