I use the
compilation-finish-functions hook to perform some actions once compilation finishes. However, unexpectedly to me the hook is also triggered when
I can't seem to find a more appropriate hook for what I'm after, namely a hook that is triggered only when
compile's compilation completes.
Is there such a hook or must I take this into consideration in my hooked functions?
This is how I hook my function (Emacs 25.1.1):
(defun display-piped-output (buffer msg) (unless (string-match "^finished" msg) (switch-to-buffer "test.log"))) (define-minor-mode moscow-compilation-mode "Expect compilation output piped to file" :global t (if moscow-compilation-mode (add-hook 'compilation-finish-functions 'display-piped-output) (remove-hook 'compilation-finish-functions 'display-piped-output)))