From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.devel Subject: Re: C-g crash redux Date: Fri, 4 Aug 2006 13:49:45 +1200 Message-ID: <17618.42937.823694.525772@kahikatea.snap.net.nz> References: <877j1qvp4k.fsf@pacem.orebokech.com> <17617.8764.824445.882539@kahikatea.snap.net.nz> <87fygd97j0.fsf@stupidchicken.com> <87zmelfihg.fsf@stupidchicken.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1154656312 15837 80.91.229.2 (4 Aug 2006 01:51:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 4 Aug 2006 01:51:52 +0000 (UTC) Cc: Romain Francoise , emacs-devel@gnu.org, "Kim F. Storm" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 04 03:51:46 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G8oqf-00031X-Rc for ged-emacs-devel@m.gmane.org; Fri, 04 Aug 2006 03:51:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G8oqf-0001PE-BG for ged-emacs-devel@m.gmane.org; Thu, 03 Aug 2006 21:51:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G8oqV-0001Nw-Dd for emacs-devel@gnu.org; Thu, 03 Aug 2006 21:51:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G8oqQ-0001Lv-40 for emacs-devel@gnu.org; Thu, 03 Aug 2006 21:51:26 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G8oqP-0001Ln-TZ for emacs-devel@gnu.org; Thu, 03 Aug 2006 21:51:21 -0400 Original-Received: from [202.37.101.8] (helo=viper.snap.net.nz) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G8otr-0007CE-V6 for emacs-devel@gnu.org; Thu, 03 Aug 2006 21:54:56 -0400 Original-Received: from kahikatea.snap.net.nz (p202-124-125-174.snap.net.nz [202.124.125.174]) by viper.snap.net.nz (Postfix) with ESMTP id 89E1A77FF5F; Fri, 4 Aug 2006 13:51:19 +1200 (NZST) Original-Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id 78433BE3A9; Fri, 4 Aug 2006 13:49:47 +1200 (NZST) Original-To: Chong Yidong In-Reply-To: <87zmelfihg.fsf@stupidchicken.com> X-Mailer: VM 7.19 under Emacs 22.0.50.16 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:58076 Archived-At: Chong Yidong writes: > >> Typing C-g, which runs interrupt_signal, runs quit_throw_to_read_char > >> instead of Fsignal during when waiting_for_input is set (as it is > >> during wait_reading_process_output). If I understand correctly, the > >> purpose is to enable read-char to return a `C-g' character; and that's > >> why it's both undesirable and unnecesssary to use a > >> record_unwind_protect inside wait_reading_process_output. > > > > Ok, I see. > > > > But how do we ensure that waiting_for_user_input_p is restored > > correctly on C-g? > > > > Or isn't that necessary? > > That's not necessary, since quit_throw_to_read_char calls > clear_waiting_for_input, which resets waiting_for_input to 0. But that might not have been the original value. > I guess someone worked all this out at some time in the past. I added > a comment to the code to clarify this. I'm not convinced that your analysis is correct, but it's in keeping with the "all bugs must be fixed" policy. I think that Fsignal should get called (perhaps with QUIT) before Emacs gets back to the command loop (or at least before further expressions/bytecode is evaluated) so that unbind_to gets called and the binding stack stays balanced. -- Nick http://www.inet.net.nz/~nickrob