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

Integrate compilation mode for justl-exec-recipe-in-dir #25

Merged
merged 2 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
4 changes: 4 additions & 0 deletions Changelog.org
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* 0.10

- Integrate compilation mode for ~justl-exec-recipe-in-dir~

* 0.9

- Handle carriage return properly on the compilation buffer.
Expand Down
20 changes: 10 additions & 10 deletions justl.el
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ ARGS is a plist that affects how the process is run.
(let* ((process (apply
#'start-file-process process-name buf command)))
(setq justl--compile-command command)

(setq-local justl--justfile (justl--justfile-from-arg (elt command 1)))
(run-hook-with-args 'compilation-start-hook process)
(set-process-filter process 'justl--process-filter)
Expand All @@ -371,6 +370,9 @@ ARGS is a plist that affects how the process is run.
(interactive)
(justl--make-process justl--compile-command (list :buffer justl--output-process-buffer
:process "just"
:directory (if justl--justfile
(f-dirname justl--justfile)
default-directory)
:mode 'justl-compile-mode)))

(defvar justl-mode-font-lock-keywords
Expand Down Expand Up @@ -426,20 +428,18 @@ ARGS is a ist of arguments."
(setq process-name justl-executable))
(let ((buffer-name justl--output-process-buffer)
(error-buffer (justl--process-error-buffer process-name))
(cmd (append (list justl-executable) args)))
(cmd (append (list justl-executable) args))
(mode 'justl-compile-mode))
(when (get-buffer buffer-name)
(kill-buffer buffer-name))
(when (get-buffer error-buffer)
(kill-buffer error-buffer))
(justl--log-command process-name cmd)
(make-process :name process-name
:buffer buffer-name
:filter 'justl--process-filter
:sentinel #'justl--sentinel
:file-handler t
:stderr nil
:command cmd)
(pop-to-buffer buffer-name)))
(justl--make-process cmd (list :buffer buffer-name
:process process-name
:directory default-directory
:mode mode)))
(pop-to-buffer justl--output-process-buffer))

(defun justl--exec-to-string (cmd)
"Replace \"shell-command-to-string\" to log to process buffer.
Expand Down