From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: UNBLOCK_INPUT again... Date: Tue, 01 Mar 2005 17:10:35 +0100 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1109695884 26416 80.91.229.2 (1 Mar 2005 16:51:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 1 Mar 2005 16:51:24 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 01 17:51:23 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D6Aa5-0006Bi-4y for ged-emacs-devel@m.gmane.org; Tue, 01 Mar 2005 17:50:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D6Asf-0006p2-I3 for ged-emacs-devel@m.gmane.org; Tue, 01 Mar 2005 12:09:57 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D6Ape-00045d-GY for emacs-devel@gnu.org; Tue, 01 Mar 2005 12:06:50 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D6Apd-00043r-B1 for emacs-devel@gnu.org; Tue, 01 Mar 2005 12:06:49 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D6Ajs-0001Ig-Qh for emacs-devel@gnu.org; Tue, 01 Mar 2005 12:00:52 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D69xH-0003Dk-8A for emacs-devel@gnu.org; Tue, 01 Mar 2005 11:10:39 -0500 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1D69xE-0003jX-4W for emacs-devel@gnu.org; Tue, 01 Mar 2005 11:10:39 -0500 Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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 X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: main.gmane.org gmane.emacs.devel:33988 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:33988 --=-=-= Hi, I mentioned that throws already restore the value of interrupt_input_blocked and so that doing so manually in keyboard.c would seem unnecessary. That would suggest the following patch: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment --- keyboard.c 16 Feb 2005 02:07:09 +0100 1.811 +++ keyboard.c 01 Mar 2005 06:07:13 +0100 @@ -1350,10 +1350,13 @@ cancel_hourglass (); #endif +#if 0 + Throwing already resets the blocked counter. /* Unblock input if we enter with input blocked. This may happen if redisplay traps e.g. during tool-bar update with input blocked. */ while (INPUT_BLOCKED_P) UNBLOCK_INPUT; +#endif return Fthrow (Qtop_level, Qnil); } --=-=-= However, this is somewhat incorrect as an analysis, since UNBLOCK_INPUT does additional action when the count returns to zero. It is defined as: #define UNBLOCK_INPUT \ do \ { \ --interrupt_input_blocked; \ if (interrupt_input_blocked == 0) \ { \ if (interrupt_input_pending) \ reinvoke_input_signal (); \ if (pending_atimers) \ do_pending_atimers (); \ } \ else if (interrupt_input_blocked < 0) \ abort (); \ } \ while (0) Now with the current approach, in keyboard.c pending timers and stuff will get run _before_ doing the actual throw. I don't know whether this is a good idea. In particular if the circumstances are such that the catch is in a situation resulting in a nonzero interrupt_input_blocked (I don't know whether this can actually happen). On the other hand, when something actually gets thrown from anywhere else, interrupt_input_blocked may get restored to zero _without_ running the pending stuff (almost all catches are in eval.c). That does not look quite right either. Could somebody with somewhat more of a clue than myself say something soothing? -- David Kastrup, Kriemhildstr. 15, 44793 Bochum --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--