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: Re: BUFFER_SWITCH_EVENT Date: Wed, 26 Sep 2018 08:27:35 -0400 Message-ID: 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> <83in2s95mn.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1537964743 5496 195.159.176.226 (26 Sep 2018 12:25:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 26 Sep 2018 12:25:43 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 26 14:25:38 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 1g58ss-0001J9-Gg for ged-emacs-devel@m.gmane.org; Wed, 26 Sep 2018 14:25:38 +0200 Original-Received: from localhost ([::1]:58649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g58uy-00054R-N2 for ged-emacs-devel@m.gmane.org; Wed, 26 Sep 2018 08:27:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g58us-00054L-Oz for emacs-devel@gnu.org; Wed, 26 Sep 2018 08:27:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g58uo-00026H-KI for emacs-devel@gnu.org; Wed, 26 Sep 2018 08:27:41 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:42770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g58uo-00025Y-Er; Wed, 26 Sep 2018 08:27:38 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w8QCRZMM025655; Wed, 26 Sep 2018 08:27:36 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id AEA686A66E; Wed, 26 Sep 2018 08:27:35 -0400 (EDT) In-Reply-To: <83in2s95mn.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 26 Sep 2018 08:42:24 +0300") X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 3 Rules triggered GEN_SPAM_FEATRE=0.1, EDT_SA_DN_PASS=0, RV6382=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6382> : inlines <6898> : streams <1799568> : uri <2718538> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 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:230082 Archived-At: >> 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. I see. I don't see why it should be read_key_sequence's responsability to "fix" those issues (and honestly, I don't see exactly what bad consequences it could have anyway. AFAIK the command loop will/should select the selected-window's buffer before running the next command). If we're preoccupied from such async changes to current-buffer, I think we should save&restore the current buffer around the code which runs process filters and timers (and indeed, if we treated them as Elisp threads, that's the behavior we'd get). Stefan