From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#46904: Non-unique windows produced by window-state-put Date: Thu, 04 Mar 2021 11:39:09 +0200 Organization: LINKOV.NET Message-ID: <87a6rj8dhe.fsf@mail.linkov.net> References: <877dmo0zdn.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23398"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 46904@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 04 11:19:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lHl4Y-0005wj-8B for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Mar 2021 11:19:10 +0100 Original-Received: from localhost ([::1]:60778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHl4X-0006Ju-8o for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Mar 2021 05:19:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHl2W-0003Kz-87 for bug-gnu-emacs@gnu.org; Thu, 04 Mar 2021 05:17:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46237) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lHl2V-0001px-6x for bug-gnu-emacs@gnu.org; Thu, 04 Mar 2021 05:17:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lHl2V-0007nQ-3A for bug-gnu-emacs@gnu.org; Thu, 04 Mar 2021 05:17:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Mar 2021 10:17:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46904 X-GNU-PR-Package: emacs Original-Received: via spool by 46904-submit@debbugs.gnu.org id=B46904.161485299029901 (code B ref 46904); Thu, 04 Mar 2021 10:17:03 +0000 Original-Received: (at 46904) by debbugs.gnu.org; 4 Mar 2021 10:16:30 +0000 Original-Received: from localhost ([127.0.0.1]:57781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHl1y-0007mD-86 for submit@debbugs.gnu.org; Thu, 04 Mar 2021 05:16:30 -0500 Original-Received: from relay12.mail.gandi.net ([217.70.178.232]:50319) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHl1w-0007lZ-Hf for 46904@debbugs.gnu.org; Thu, 04 Mar 2021 05:16:28 -0500 Original-Received: from mail.gandi.net (m91-129-96-116.cust.tele2.ee [91.129.96.116]) (Authenticated sender: juri@linkov.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 4283F20000C; Thu, 4 Mar 2021 10:16:22 +0000 (UTC) In-Reply-To: (martin rudalics's message of "Thu, 4 Mar 2021 09:35:26 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:201373 Archived-At: >> >> Every time the selected window remains the same: >> >> # >> >> But after splitting the window with e.g. 'C-x 2', >> evaluating the same every time creates a new window >> that it's expected to do even when there is only one window >> on the frame. > > You mean we should do that > > ;; Create a new window to replace the existing one. > (setq window (prog1 (split-window window) > (delete-window window))))) > > in the one window case too? This would be certainly more consistent but This looks like the right fix. > I do not remember any more why this is needed in the multiple windows > case. And I do not remember it too, maybe the current logic handled some use cases, maybe not. >> I don't know how severe are the consequences. The only side-effect I noticed >> that prev-buffers of restored windows are the same on different tabs because >> they share the same window. > > If that is a problem and the above would help, let's do it. It couldn't > possibly harm unless the root window is too small to get split and we > want to put only one window there; so we should handle that special case. I'll try this, thanks.