From: Eli Zaretskii <eliz@gnu.org>
To: Karl Fogel <kfogel@red-bean.com>
Cc: emacs-devel@gnu.org
Subject: Re: PROPOSAL: Control over process cleanup in `save-buffers-kill-emacs'.
Date: Fri, 22 Sep 2017 22:26:48 +0300 [thread overview]
Message-ID: <834lrucz5z.fsf@gnu.org> (raw)
In-Reply-To: <87poai36hq.fsf@red-bean.com> (message from Karl Fogel on Fri, 22 Sep 2017 13:58:41 -0500)
> From: Karl Fogel <kfogel@red-bean.com>
> 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.
prev parent reply other threads:[~2017-09-22 19:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-22 18:58 PROPOSAL: Control over process cleanup in `save-buffers-kill-emacs' Karl Fogel
2017-09-22 19:11 ` Davis Herring
2017-09-22 19:26 ` Eli Zaretskii [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=834lrucz5z.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=kfogel@red-bean.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.