Skip to content

Commit

Permalink
fix(command): bind setup function when capturing recompile
Browse files Browse the repository at this point in the history
  • Loading branch information
Walheimat committed Jul 22, 2024
1 parent 2e4f26c commit 83983dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ship-mate.el
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ EDIT is passed as-is to all invocations of RECOMPILE."
((ship-mate--command-buffer-p)
(let* ((cmd ship-mate--this-command)
(history (ship-mate-command--history ship-mate--this-command))
(compile-history (and history (ring-elements history))))
(compile-history (and history (ring-elements history)))
(compilation-process-setup-function #'ship-mate-command--reserve))

(with-current-buffer (funcall-interactively recompile edit)

Expand Down
3 changes: 3 additions & 0 deletions test/ship-mate-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@
(:mock ship-mate-command--fuzzy-match :return matches)
(:mock ship-mate--local-value :return environment)
(:mock ship-mate-command--last-command :var last :initial nil)
(:watch compilation-process-setup-function)
ship-mate-command--update-history
ship-mate-command)

Expand All @@ -488,6 +489,8 @@

(ship-mate-command--capture (lambda (&rest _) (current-buffer)))

(bydi-was-set-to compilation-process-setup-function #'ship-mate-command--reserve)

(bydi-was-called-with ship-mate-command--update-history
'(test "make recompile" t)))))

Expand Down

0 comments on commit 83983dc

Please sign in to comment.