From a3b87171899f34a4c194b7f563077e465566b751 Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Sat, 3 Sep 2022 12:48:56 +0530 Subject: [PATCH 1/3] Fix documentation and v0.10 release --- Changelog.org | 1 + README.org | 2 +- justl.el | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Changelog.org b/Changelog.org index 646eea7..fa10aef 100644 --- a/Changelog.org +++ b/Changelog.org @@ -1,6 +1,7 @@ * 0.10 - Integrate compilation mode for ~justl-exec-recipe-in-dir~ +- Fix documentation in README. * 0.9 diff --git a/README.org b/README.org index 92107dc..2690e66 100644 --- a/README.org +++ b/README.org @@ -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 diff --git a/justl.el b/justl.el index ace7682..2210538 100644 --- a/justl.el +++ b/justl.el @@ -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 @@ -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: ;; From 1a60c26b4b2de5456f910cc961b4d5234415a75a Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Sat, 3 Sep 2022 14:19:30 +0530 Subject: [PATCH 2/3] Improve performance of refresh buffer Also the UX when there is an error in the justfile syntax. Fixes https://github.com/psibi/justl.el/issues/23 --- justl.el | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/justl.el b/justl.el index 2210538..a7acc37 100644 --- a/justl.el +++ b/justl.el @@ -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) @@ -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." @@ -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 From 6ffcca8e51afec7523b676b156cc299fcb822950 Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Sat, 3 Sep 2022 14:28:55 +0530 Subject: [PATCH 3/3] Update changelog --- Changelog.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Changelog.org b/Changelog.org index fa10aef..cacaad5 100644 --- a/Changelog.org +++ b/Changelog.org @@ -1,7 +1,9 @@ * 0.10 - Integrate compilation mode for ~justl-exec-recipe-in-dir~ -- Fix documentation in README. +- 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