Function: server-sentinel

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

Signature

(server-sentinel PROC MSG)

Documentation

The process sentinel for Emacs server connections.

Source Code

;; Defined in /usr/src/emacs/lisp/server.el.gz
(defun server-sentinel (proc msg)
  "The process sentinel for Emacs server connections."
  ;; If this is a new client process, set the query-on-exit flag to nil
  ;; for this process (it isn't inherited from the server process).
  (when (and (eq (process-status proc) 'open)
	     (process-query-on-exit-flag proc))
    (set-process-query-on-exit-flag proc nil))
  ;; Delete the associated connection file, if applicable.
  ;; Although there's no 100% guarantee that the file is owned by the
  ;; running Emacs instance, server-start uses server-running-p to check
  ;; for possible servers before doing anything, so it *should* be ours.
  (and (process-contact proc :server)
       (eq (process-status proc) 'closed)
       ;; If this variable is non-nil, the socket was passed in to
       ;; Emacs, and not created by Emacs itself (for instance,
       ;; created by systemd).  In that case, don't delete the socket.
       (not internal--daemon-sockname)
       (ignore-errors
	 (delete-file (process-get proc :server-file))))
  (server-log (format "Status changed to %s: %s"
                      (process-status proc) msg) proc)
  (server-delete-client proc))