From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: BUFFER_SWITCH_EVENT Date: Wed, 26 Sep 2018 08:42:24 +0300 Message-ID: <83in2s95mn.fsf@gnu.org> References: <87sh1y535s.fsf@web.de> <8336tyc1ou.fsf@gnu.org> <87mus64wwr.fsf@web.de> <831s9hafl7.fsf@gnu.org> <83wor98t2o.fsf@gnu.org> <83va6t8rts.fsf@gnu.org> <83tvmd8p0z.fsf@gnu.org> <83pnx18kjc.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1537940474 28551 195.159.176.226 (26 Sep 2018 05:41:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 26 Sep 2018 05:41:14 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 26 07:41:10 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 1g52ZO-0007IR-Ot for ged-emacs-devel@m.gmane.org; Wed, 26 Sep 2018 07:41:06 +0200 Original-Received: from localhost ([::1]:56556 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g52bV-00033x-Cm for ged-emacs-devel@m.gmane.org; Wed, 26 Sep 2018 01:43:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g52aj-0002x2-G6 for emacs-devel@gnu.org; Wed, 26 Sep 2018 01:42:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g52ag-0003AO-AN for emacs-devel@gnu.org; Wed, 26 Sep 2018 01:42:29 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g52ag-0003AK-6T; Wed, 26 Sep 2018 01:42:26 -0400 Original-Received: from [176.228.60.248] (port=3107 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g52af-0002sl-QU; Wed, 26 Sep 2018 01:42:26 -0400 In-reply-to: (message from Stefan Monnier on Tue, 25 Sep 2018 17:50:21 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:230078 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org > Date: Tue, 25 Sep 2018 17:50:21 -0400 > > >> - if (fix_current_buffer) > >> - { > >> - if (! FRAME_LIVE_P (XFRAME (selected_frame))) > >> - Fkill_emacs (Qnil); > >> - if (XBUFFER (XWINDOW (selected_window)->contents) > >> - != current_buffer) > >> - Fset_buffer (XWINDOW (selected_window)->contents); > >> - } > > This part restores the current buffer from the selected-window's > > buffer. With it deleted, what if a process filter or a timer switches > > buffers while we are processing a key sequence? > > Indeed, what if? > > This is read_key_sequence: its return value should depend on where the > keys&buttons are pressed No, I meant the effect of the above on the global state, not on what read_key_sequence returns. keyboard.c code is not only about reading input, it is part of the main loop, so it affects the global state due to changes done by timers, process filters, etc.