From cb004b66fed7ef6d72e8f28fb6ed60164f367246 Mon Sep 17 00:00:00 2001 From: Lucas Sta Maria Date: Fri, 25 Oct 2024 02:03:11 -0400 Subject: [PATCH] feat(emacs): add `justl-recipes` interactive command Signed-off-by: Lucas Sta Maria --- .emacs.d/include/misc.el | 16 ++++++++++++++++ .emacs.d/init.el | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.emacs.d/include/misc.el b/.emacs.d/include/misc.el index cc9367f..2f5b1eb 100644 --- a/.emacs.d/include/misc.el +++ b/.emacs.d/include/misc.el @@ -9,6 +9,7 @@ (require 'lsp-mode) (require 'git-gutter) (require 'seq) +(require 'justl) (defun config-compile () "(Re)compile the current Emacs configuration." @@ -267,6 +268,21 @@ ("FIXME" . "#ffffff") ("XXXX*" . "#ffffff"))) +;; justl + +(defun justl-recipes () + "Pick and execute a just recipe." + (interactive) + (let* ((justfile (justl--find-justfile default-directory)) + (raw-entries (justl--get-recipes justfile)) + (entry-names (mapcar #'justl--recipe-name raw-entries)) + (just-recipe (completing-read "just recipe: " entry-names nil t nil))) + (justl--exec + justl-executable + just-recipe + (append (transient-args 'justl-help-popup) + (list just-recipe))))) + ;; rjsx (setq auto-mode-alist (cons '("\\.tsx$" . rjsx-mode) auto-mode-alist)) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 1247d4b..7b3eb13 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -189,7 +189,7 @@ (use-package rjsx-mode :straight t) (use-package just-mode :straight t) (use-package justl :straight t - :bind (("C-c j" . #'justl))) + :bind (("C-c j" . #'justl-recipes))) (use-package scribble-mode :straight t) (use-package go-mode :straight t) (use-package auctex :straight t)