From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Davis Herring Newsgroups: gmane.emacs.devel Subject: Re: PROPOSAL: Control over process cleanup in `save-buffers-kill-emacs'. Date: Fri, 22 Sep 2017 13:11:07 -0600 Organization: XCP-1 Message-ID: References: <87poai36hq.fsf@red-bean.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1506107544 11032 195.159.176.226 (22 Sep 2017 19:12:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 22 Sep 2017 19:12:24 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 To: Karl Fogel , Emacs Development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 22 21:12:18 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvTN3-0002TG-R2 for ged-emacs-devel@m.gmane.org; Fri, 22 Sep 2017 21:12:17 +0200 Original-Received: from localhost ([::1]:60686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvTNB-000338-5l for ged-emacs-devel@m.gmane.org; Fri, 22 Sep 2017 15:12:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvTN4-00031k-L4 for emacs-devel@gnu.org; Fri, 22 Sep 2017 15:12:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvTMz-0007X9-IQ for emacs-devel@gnu.org; Fri, 22 Sep 2017 15:12:18 -0400 Original-Received: from proofpoint7.lanl.gov ([204.121.3.46]:55940) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dvTMz-0007W3-8X for emacs-devel@gnu.org; Fri, 22 Sep 2017 15:12:13 -0400 Original-Received: from pps.filterd (proofpoint7.lanl.gov [127.0.0.1]) by proofpoint7.lanl.gov (8.16.0.21/8.16.0.21) with SMTP id v8MJA66F106481; Fri, 22 Sep 2017 13:11:08 -0600 Original-Received: from mailrelay2.lanl.gov (mailrelay2.lanl.gov [128.165.4.103]) by proofpoint7.lanl.gov with ESMTP id 2d12bavttf-1; Fri, 22 Sep 2017 13:11:08 -0600 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 2B251EB1C48; Fri, 22 Sep 2017 13:11:08 -0600 (MDT) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay2.lanl.gov Original-Received: from bismuth.lanl.gov (bismuth.lanl.gov [128.165.246.103]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 10847EB1C44; Fri, 22 Sep 2017 13:11:08 -0600 (MDT) In-Reply-To: <87poai36hq.fsf@red-bean.com> Content-Language: en-US X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-09-22_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709220265 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 204.121.3.46 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:218700 Archived-At: > This means that neither `kill-emacs-query-functions' nor `kill-emacs-hook' happen in time to offer any fine-grained control over whether the user gets queried about active processes. And since the `confirm-kill-processes' flag applies to all processes, one can't use it to customize *which* processes one is queried about at exit time. > > 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. Given your use case, it seems a lot less hackish to just introduce a user option that is one of 1. an abnormal hook called with each new process started This would allow the use of `set-process-query-on-exit-flag' in a natural way, but would run before any existing code configured the process in similar fashion. 2. a new normal hook called at the beginning of `save-buffers-kill-emacs' This would also allow the existing flag to be used, and would be unsurprising and easy to find. 3. a regular expression matching process and/or process-buffer names for which not to query on exit This would allow access by non-programmers, but would make the query flag something of a lie. Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.