Skip to content

Commit

Permalink
Merge pull request #26 from psibi/v10-release
Browse files Browse the repository at this point in the history
Prepare for v10 release
  • Loading branch information
psibi authored Sep 3, 2022
2 parents 8414bc8 + 6ffcca8 commit c1995b1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
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

0 comments on commit c1995b1

Please sign in to comment.