Usually, if you want to start something after the compilation is complete, add it to the compilation command. For example, instead of
M-x compile RET make RET
You can enter
M-x compile RET make && ./test RET
- ,
M-x compile RET make test RET
, , eshell, .
, eshell, compilation-finish-functions:
. : , .
, , "finished\n", . - :
(defun run-compilation-output-in-eshell (buf msg)
"If compilation finished successfully, switch to eshell and execute a command."
(when (string= msg "finished\n")
(eshell)
(goto-char (point-max))
(eshell-kill-input)
(insert "echo command goes here")
(eshell-send-input)))
(add-hook 'compilation-finish-functions #'run-compilation-output-in-eshell)
: eshell , . , .