From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: BUFFER_SWITCH_EVENT (was: while-no-input interrupted by *shell*) Date: Tue, 25 Sep 2018 11:25:50 -0400 Message-ID: References: <87sh1y535s.fsf@web.de> <8336tyc1ou.fsf@gnu.org> <87mus64wwr.fsf@web.de> <831s9hafl7.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1537890706 1688 195.159.176.226 (25 Sep 2018 15:51:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 25 Sep 2018 15:51:46 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 25 17:51:42 2018 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 1g4pcj-0000Mg-UO for ged-emacs-devel@m.gmane.org; Tue, 25 Sep 2018 17:51:42 +0200 Original-Received: from localhost ([::1]:53893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4peq-0001lX-Ef for ged-emacs-devel@m.gmane.org; Tue, 25 Sep 2018 11:53:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4pDw-0001VJ-7O for emacs-devel@gnu.org; Tue, 25 Sep 2018 11:26:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4pDs-0003Rx-02 for emacs-devel@gnu.org; Tue, 25 Sep 2018 11:26:04 -0400 Original-Received: from [195.159.176.226] (port=53889 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g4pDr-0003QG-OM for emacs-devel@gnu.org; Tue, 25 Sep 2018 11:25:59 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1g4pBi-0000VG-Q4 for emacs-devel@gnu.org; Tue, 25 Sep 2018 17:23:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 22 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:bXfEtqmvaAgdm50jSYEZ4YGZ0Ag= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 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:230062 Archived-At: > When output from a subprocess arrives, we insert a buffer-switch event > into the input queue, and that counts as input. Therefater, any code > that calls maybe_quit will cause while-no-input to throw. The > backtrace which shows that is below, for the record. > Here's a patch, comments welcome. Looks good, thanks. I do wonder what these BUFFER_SWITCH_EVENT are for, tho. In record_asynch_buffer_change it says: /* We don't need a buffer-switch event unless Emacs is waiting for input. The purpose of the event is to make read_key_sequence look up the keymaps again. If we aren't in read_key_sequence, we don't need one, and the event could cause trouble by messing up (input-pending-p). Note: Fwaiting_for_user_input_p always returns nil when async subprocesses aren't supported. */ but I don't see why we'd need to look up the keymaps again. Stefan