Variable: server-stop-automatically

server-stop-automatically is a customizable variable defined in server.el.gz.

Value

nil

Documentation

If non-nil, stop the server under the requested conditions.

If this is the symbol empty, stop the server when it has no remaining clients, no remaining unsaved file-visiting buffers, and no running processes with a query-on-exit flag.

If this is the symbol delete-frame, ask the user when the last frame is deleted whether each unsaved file-visiting buffer must be saved and each running process with a query-on-exit flag can be stopped, and if so, stop the server itself.

If this is the symbol kill-terminal, ask the user when the terminal is killed with C-x C-c (save-buffers-kill-terminal) whether each unsaved file-visiting buffer must be saved and each running process with a query-on-exit flag can be stopped, and if so, stop the server itself.

This variable was added, or its default value changed, in Emacs 29.1.

View in manual

Probably introduced at or before Emacs version 29.1.

Source Code

;; Defined in /usr/src/emacs/lisp/server.el.gz
(defcustom server-stop-automatically nil
  "If non-nil, stop the server under the requested conditions.

If this is the symbol `empty', stop the server when it has no
remaining clients, no remaining unsaved file-visiting buffers,
and no running processes with a `query-on-exit' flag.

If this is the symbol `delete-frame', ask the user when the last
frame is deleted whether each unsaved file-visiting buffer must
be saved and each running process with a `query-on-exit' flag
can be stopped, and if so, stop the server itself.

If this is the symbol `kill-terminal', ask the user when the
terminal is killed with \\[save-buffers-kill-terminal] \
whether each unsaved file-visiting
buffer must be saved and each running process with a `query-on-exit'
flag can be stopped, and if so, stop the server itself."
  :type '(choice
          (const :tag "Never" nil)
          (const :tag "When no clients, unsaved files, or processes"
                 empty)
          (const :tag "When killing last terminal" kill-terminal)
          (const :tag "When killing last terminal or frame" delete-frame))
  :set (lambda (symbol value)
         (set-default symbol value)
         (server-apply-stop-automatically))
  :version "29.1")