Function: process-kill-buffer-query-function

process-kill-buffer-query-function is a byte-compiled function defined in subr.el.gz.

Signature

(process-kill-buffer-query-function)

Documentation

Ask before killing a buffer that has a running process.

View in manual

Probably introduced at or before Emacs version 23.2.

Source Code

;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defun process-kill-buffer-query-function ()
  "Ask before killing a buffer that has a running process."
  (let ((process (get-buffer-process (current-buffer))))
    (or (not process)
        (not (memq (process-status process) '(run stop open listen)))
        (not (process-query-on-exit-flag process))
        (yes-or-no-p
	 (format "Buffer %S has a running process; kill it? "
		 (buffer-name (current-buffer)))))))