From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Really prevent quitting in sensitive contexts Date: Wed, 11 Mar 2020 19:32:18 -0700 Message-ID: <7eced910-43dd-5e62-a864-beded660a07e@dancol.org> References: <20200312020554.194607-1-dancol@dancol.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="97018"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 12 03:34:20 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jCDfv-000P5a-T0 for ged-emacs-devel@m.gmane-mx.org; Thu, 12 Mar 2020 03:34:19 +0100 Original-Received: from localhost ([::1]:60706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCDfu-0001YA-RH for ged-emacs-devel@m.gmane-mx.org; Wed, 11 Mar 2020 22:34:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42645) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCDe3-0000UL-TQ for emacs-devel@gnu.org; Wed, 11 Mar 2020 22:32:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCDe1-00084L-Ll for emacs-devel@gnu.org; Wed, 11 Mar 2020 22:32:23 -0400 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:49990) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jCDe1-00083c-3L for emacs-devel@gnu.org; Wed, 11 Mar 2020 22:32:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=YVWOS1/K5+J1ulavXk96ePRUo0B9LiyvHnQq6mYK8zg=; b=f47EdpHefjzwfAISAprXinK+Cm cZpopI77KkeB5wQ3bCqibu1i9/KUFbeuKMpt8OlM3di4umlk4X2oZB3V9/LYUuYitkgYlYmLyWwnp Bu9/eV02yG/e8Ls134SA4ggAIQjWKmwAKgoZabceFlUkAErfRUm78QKfTFSoIB6EKgt25YyZIA7uA 89gU1vj1QCU5cgRRiXVawAnYZiAzYsZ1V4kSn/eLGh1f+VIK9OQMz6JIRF/J5MOwZo4CFmop0xL17 zW2xS83trDGBcbM37zERAKSB4mSl4kk0c20QSixJo2rCFix++AegwLv6r1LeZZzTHgtmqNAl0pTXL MAY06w/w==; Original-Received: from [2604:4080:1321:9a00:8088:871:458b:add0] by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jCDdz-0007sM-HQ; Wed, 11 Mar 2020 19:32:19 -0700 In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:245482 Archived-At: On 3/11/20 7:20 PM, Stefan Monnier wrote: >> with-local-quit is actually documented to allow this sort of >> foreground quitting, > > AFAIK it's not just documented to allow that, but it's designed > specifically for that. Right, but I can imagine it being useful more generally in some code that wants to be atomic against quit, but with exceptions. I don't know of any such code though. >> but since the interactive C-g race is unavoidable, we should deprecate >> use of with-local-quit for this purpose. > > I tend to agree. > >> This change adds a new inhibit-quit-override flag. > > Sounds like an arm's race: then we'll have to add > a with-local-quit-override-override, etc... I considered making with-local-quit-override inaccessible from Lisp. >> +behaves as if 'inhibit-quit' were t. This change prevents >> +with-local-quit from accidentally allowing quits inside process >> +filters, redisplay callbacks, and other special contexts. > > I'm not really familiar with those accidental cases. > Maybe they can be fixed more directly by not using with-local-quit? with-local-quit has been there for ten years. Can we just delete it? > > Are there bug#NNN where these are discussed? No. The motiviation is Tramp inflooping after a quit because it uses with-local-quit inside tramp-accept-process-output, which causes tramp-wait-for-regexp to retry infinitely and quickly. I found *that* behavior trying to figure out why M-x compile over Tramp was hanging not only Emacs, but also the SSH connection more generally. I *think* it has something to do with compilation-filter calling file-truename, which invokes Tramp's handler, which wants to talk over the same SSH connection that's spewing compilation messages, deadlocking something somewhere. We probably should make compile not filename lookup directly in the process filter.