The answers here solve the question but for completness I will show my solution based on YoungFrog answer which in my opinion leads to a problematic state where no more confirmation will be asked for any process buffer killing.
Context
I just want to be able to kill *ansi-term-1*
buffer with no confirmation :
(defun perso/close-shell ()
;; remove confirmation for process buffers
(setq kill-buffer-query-functions
(delq 'process-kill-buffer-query-function kill-buffer-query-functions))
(kill-buffer "*ansi-term-1*")
;; confirmation is now active for other process buffer
(add-to-list 'kill-buffer-query-functions 'process-kill-buffer-query-function))
and revert to the previous state where confirmation is asked for other process buffers.
run-scheme
) when exiting still a dialog pops up and asks "Active processes exist; kill them and exit anyway?". – user905686 Aug 24 '16 at 10:32save-buffers-kill-emacs
and unrelated to killing the buffers. – YoungFrog Aug 24 '16 at 11:48