From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Unconditional quit on SIGUSR2 Date: Mon, 28 Mar 2011 12:49:53 -0700 Message-ID: <4D90E661.40207@gmail.com> References: <4D90354E.9000704@gmail.com> <4D908F5F.8000303@gmail.com> <4D90C42F.9060500@gmail.com> <83bp0vrszf.fsf@gnu.org> <4D90E199.2040809@gmail.com> <83aagfrq1y.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1301341812 13049 80.91.229.12 (28 Mar 2011 19:50:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Mar 2011 19:50:12 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 28 21:50:07 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4IRz-0002xq-7t for ged-emacs-devel@m.gmane.org; Mon, 28 Mar 2011 21:50:07 +0200 Original-Received: from localhost ([127.0.0.1]:35383 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4IRy-00062P-Bu for ged-emacs-devel@m.gmane.org; Mon, 28 Mar 2011 15:50:06 -0400 Original-Received: from [140.186.70.92] (port=33451 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4IRt-0005xs-71 for emacs-devel@gnu.org; Mon, 28 Mar 2011 15:50:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4IRs-0001NS-4J for emacs-devel@gnu.org; Mon, 28 Mar 2011 15:50:00 -0400 Original-Received: from mail-pv0-f169.google.com ([74.125.83.169]:48396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4IRq-0001Ms-3w; Mon, 28 Mar 2011 15:49:58 -0400 Original-Received: by pvg4 with SMTP id 4so834363pvg.0 for ; Mon, 28 Mar 2011 12:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=RBcRxfoVv13hEMNJtD4iZWlVU76NznpowTcKJUORZQY=; b=xNJQOugby+mBQ5Q9Mt17l42xl90yVhhQnZOaQb0qs4sUe7VlDgI7WsGNN7TtctWLF2 ZAHuwdBg4Rxy27vuYCHaFvxKEeG0eK7fNQS0b8rPJuTxGLhsumelJ+P7up5ITQNjupc4 JTEtSdPbS6ktSHgv28Czd6tR/91MI2sDgLLIk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=yDag5oQCKo+Q8GPl+loMszgpn2pKVkmgQv+cp8WaPG4zIEYhbYUt0OKwWfnDFxaUhB cxo8lDAcRnAXyoFcIg5zwjEGarYnWl8/Ck51+vrOpYMtRmdct5EbnPOaskIHzKvjE1An zEMp9UOwpbH4mSpgkf3H5C5S5gx5CZkwa5tpk= Original-Received: by 10.142.12.16 with SMTP id 16mr3876156wfl.253.1301341796819; Mon, 28 Mar 2011 12:49:56 -0700 (PDT) Original-Received: from [0.0.0.0] (c-67-183-23-114.hsd1.wa.comcast.net [67.183.23.114]) by mx.google.com with ESMTPS id p40sm6243297wfc.17.2011.03.28.12.49.55 (version=SSLv3 cipher=OTHER); Mon, 28 Mar 2011 12:49:55 -0700 (PDT) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 In-Reply-To: <83aagfrq1y.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.83.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:137799 Archived-At: On 3/28/2011 12:41 PM, Eli Zaretskii wrote: > We are miscommunicating: I meant that delivering a SIGTERM will end up > in fatal_error_signal, which will save all that's worth saving, before > Emacs commits suicide. Your patch achieves the same goal, as far as > saving unsaved work is concerned, except it uses SIGUSR2. My patch does not do the same thing. Instead, my patch returns the user to an *interactive* context where he can continue using Emacs normally after resolving whatever was causing the infinite loop (perhaps by closing a buffer, or setting some configuration variables). It is not an unconditional quit the same way SIGTERM is. >> We want to be able to interrupt code running in a tight loop in >> situations when quit would normally be disabled, such as during >> redisplay. Quit is disabled during background work for a good reason, >> so we shouldn't just rely on the normal quit mechanism. > If it is safe to interrupt font-lock with the method used by your > patch, it should be safe to enable quitting when redisplay calls > font-lock, right? So maybe we should simply enable quite when > redisplay calls font-lock and disable it when font-lock returns back > to redisplay code which called it. Then C-g will be able to interrupt > it. Would that solve the problem with font-lock that gets stuck? It would solve that problem but introduce another: users have no way of knowing went font-lock happens. Innocently typing C-g at the wrong time can terminate font lock and leave parts of the buffer unfontified. It's inherently racy. We need an alternate mechanism that is not as easy to trigger. Signals provide such a mechanism.