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))
      (unwind-protect
          (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))))
        (setq compilation-in-progress (delq proc compilation-in-progress))
        (compilation--update-in-progress-mode-line)
        ;; 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))))