Next: , Previous: Sentinels, Up: Processes

36.11 Querying Before Exit

When Emacs exits, it terminates all its subprocesses by sending them the SIGHUP signal. Because subprocesses may be doing valuable work, Emacs normally asks the user to confirm that it is ok to terminate them. Each process has a query flag, which, if non-nil, says that Emacs should ask for confirmation before exiting and thus killing that process. The default for the query flag is t, meaning do query.

— Function: process-query-on-exit-flag process

This returns the query flag of process.

— Function: set-process-query-on-exit-flag process flag

This function sets the query flag of process to flag. It returns flag.

Here is an example of using set-process-query-on-exit-flag on a shell process to avoid querying:

          (set-process-query-on-exit-flag (get-process "shell") nil)
               ⇒ nil