[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PROPOSAL: Control over process cleanup in `save-buffers-kill-emacs'.
From: |
Eli Zaretskii |
Subject: |
Re: PROPOSAL: Control over process cleanup in `save-buffers-kill-emacs'. |
Date: |
Fri, 22 Sep 2017 22:26:48 +0300 |
> From: Karl Fogel <address@hidden>
> Date: Fri, 22 Sep 2017 13:58:41 -0500
>
> I propose moving `kill-emacs-query-functions' to before the process-killing
> block, so that hooks can do things with processes before Emacs asks about
> those processes. I haven't tested this patch yet, but this gives the idea:
We have process-query-on-exit-flag for that.
> But I can't easily do `set-process-query-on-exit-flag' at the time the IMAP
> processes are started, since I just run `M-x gnus' and then somewhen after
> that something runs IMAP (maybe there's a hook for this somewhere, but if so,
> I haven't found it yet).
Then perhaps we need a facility to set this flag on certain classes of
processes?
> But I could put code like this into a hook, if only there were a hook that
> were run before the process-killing block in `save-buffers-kill-emacs':
>
> (mapcar (lambda (buf)
> (when (string-match "^ \\*imap source\\*.*" (buffer-name buf))
> (message "shutting down IMAP process '%s'" (get-buffer-process
> buf))
> (set-process-query-on-exit-flag (get-buffer-process buf) nil)
> (kill-buffer buf)))
> (buffer-list))
Why cannot you do something similar in the process sentinel, which is
called when the process begins? Or maybe Gnus should provide a
facility to set this flag for the processes it starts?
In any case, if this is somehow impossible today, I think we should
extend the facilities that allow setting this flag, instead of
inventing a separate parallel mechanism.
Thanks.