Function: compilation-sentinel

compilation-sentinel is a byte-compiled function defined in compile.el.gz.

Signature

(compilation-sentinel PROC MSG)

Documentation

Sentinel for compilation buffers.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/compile.el.gz
;; Called when compilation process changes state.
(defun compilation-sentinel (proc msg)
  "Sentinel for compilation buffers."
  (if (memq (process-status proc) '(exit signal))
      (let ((buffer (process-buffer proc)))
	(if (null (buffer-name buffer))
	    ;; buffer killed
	    (set-process-buffer proc nil)
	  (with-current-buffer buffer
	    ;; Write something in the compilation buffer
	    ;; and hack its mode line.
	    (compilation-handle-exit (process-status proc)
				     (process-exit-status proc)
				     msg)
	    ;; Since the buffer and mode line will show that the
	    ;; process is dead, we can delete it now.  Otherwise it
	    ;; will stay around until M-x list-processes.
	    (delete-process proc)))
        (setq compilation-in-progress (delq proc compilation-in-progress))
        (compilation--update-in-progress-mode-line))))