summaryrefslogtreecommitdiff
path: root/devdocs/elisp/query-before-exit.html
blob: 120390b28b56688df2b8e5494b41801ced784717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 <h3 class="section">Querying Before Exit</h3> <p>When Emacs exits, it terminates all its subprocesses. For subprocesses that run a program, it sends them the <code>SIGHUP</code> signal; connections are simply closed. 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-<code>nil</code>, says that Emacs should ask for confirmation before exiting and thus killing that process. The default for the query flag is <code>t</code>, meaning <em>do</em> query. </p> <dl> <dt id="process-query-on-exit-flag">Function: <strong>process-query-on-exit-flag</strong> <em>process</em>
</dt> <dd><p>This returns the query flag of <var>process</var>. </p></dd>
</dl> <dl> <dt id="set-process-query-on-exit-flag">Function: <strong>set-process-query-on-exit-flag</strong> <em>process flag</em>
</dt> <dd>
<p>This function sets the query flag of <var>process</var> to <var>flag</var>. It returns <var>flag</var>. </p> <p>Here is an example of using <code>set-process-query-on-exit-flag</code> on a shell process to avoid querying: </p> <div class="example"> <pre class="example">(set-process-query-on-exit-flag (get-process "shell") nil)
     ⇒ nil
</pre>
</div> </dd>
</dl> <dl> <dt id="confirm-kill-processes">User Option: <strong>confirm-kill-processes</strong>
</dt> <dd><p>If this user option is set to <code>t</code> (the default), then Emacs asks for confirmation before killing processes on exit. If it is <code>nil</code>, Emacs kills processes without confirmation, i.e., the query flag of all processes is ignored. </p></dd>
</dl><div class="_attribution">
  <p class="_attribution-p">
    Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
    <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Query-Before-Exit.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Query-Before-Exit.html</a>
  </p>
</div>