From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Proposed removal of struct frame->select_mini_window_flag. Date: Wed, 18 May 2022 20:16:24 +0300 Message-ID: <83leuyep7b.fsf@gnu.org> References: <83pmkaertm.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12491"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 18 19:18:27 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrNJb-00032W-Kd for ged-emacs-devel@m.gmane-mx.org; Wed, 18 May 2022 19:18:27 +0200 Original-Received: from localhost ([::1]:48002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nrNJa-0007zd-Gg for ged-emacs-devel@m.gmane-mx.org; Wed, 18 May 2022 13:18:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrNHk-0005Z1-QW for emacs-devel@gnu.org; Wed, 18 May 2022 13:16:32 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:35308) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrNHk-00059q-3D; Wed, 18 May 2022 13:16:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=knp5GFHIBMYd6AHpTJ/2VqkwJoWp5FDGuvQbmS4ysYk=; b=pV+WKb6jX/U7 Yl67/BjzRlzphbZ+Ddo49K6Ly51YZdpck+K5lZ0uooeRqgKmTdAvXfOzAlkKcYsWRBXL+WwVljqGs Py8IIz/6NrvYvgRq0nYO64oOs49I2ewQjO7JFkcVmm3Tozs5voKWvgY+1ScT03WxPUTe6Sygx7zGa 1PlZedAGzTm3cC1kpg1UBP2nYKU49iGpG6tRiSQ7TxG6p3t07JMuRGBmY0X2NSq+a/o6j2reJYWWy 7N8f1lT3YxN5krPu2vjyMwiHoiYdqr5fk1g9mEcJJ+FhXug9+aFn33cCtojSbq/b9EgFg0hKbjT/F NolnWCKPSUl2ujRc92WjhA==; Original-Received: from [87.69.77.57] (port=4834 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrNHi-00004z-UB; Wed, 18 May 2022 13:16:31 -0400 In-Reply-To: (message from Alan Mackenzie on Wed, 18 May 2022 17:03:13 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:289927 Archived-At: > Date: Wed, 18 May 2022 17:03:13 +0000 > Cc: emacs-devel@gnu.org > From: Alan Mackenzie > > > sf->select_mini_window_flag = MINI_WINDOW_P (XWINDOW (sf->selected_window)); > > > selected_frame = frame; > > > move_minibuffers_onto_frame (sf, for_deletion); > > > if (f->select_mini_window_flag > > && !NILP (Fminibufferp (XWINDOW (f->minibuffer_window)->contents, Qt))) > > f->selected_window = f->minibuffer_window; > > Yes, I saw it. > > > How will this logic work without that flag? > > There is no logic which uses it. How do you mean "no logic"? I mean this logic, right there: if (f->select_mini_window_flag && !NILP (Fminibufferp (XWINDOW (f->minibuffer_window)->contents, Qt))) f->selected_window = f->minibuffer_window; > These lines in frame.c set the flag in > sf (the old frame), and test it in f (the new frame). It is intended to > be a durable flag saying whether or not the mini-window in a non-selected > frame is to be selected at the next do_switch_frame () into it. This > might make sense if there were something setting f->selected_window without > going through the proper functions. The code above does just that, does it not? It directly sets f->selected_window. > What we do have is the setting of the flag unconditionally to false in > select_window (window.c), with no attempt being made to save and restore > the current value. Considering that Fselect_window can be called from > gui_consider_frame_title (xdisp.c) during a redisplay (with the current > bug fix), this means the flag can be initialised to false asynchronously > at any time. What do you mean by "asynchronously"? gui_consider_frame_title is not called asynchronously, at least under my interpretation of that term.