From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames Date: Sat, 28 Jan 2023 16:35:52 +0100 Message-ID: References: <834jsccepb.fsf@gnu.org> <83sffuap62.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28858"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tgbugs@gmail.com, emacs-devel@gnu.org, larsi@gnus.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jan 28 16:36:49 2023 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 1pLnG4-0007GH-Re for ged-emacs-devel@m.gmane-mx.org; Sat, 28 Jan 2023 16:36:48 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLnFL-00035L-Ej; Sat, 28 Jan 2023 10:36:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pLnFJ-00035C-E2 for emacs-devel@gnu.org; Sat, 28 Jan 2023 10:36:01 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pLnFH-0006my-BW; Sat, 28 Jan 2023 10:36:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.at; s=s31663417; t=1674920154; bh=z78MtRZ3eCw+yypgFdxgb5EWMnu1oqrusJvFEs84zVg=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=UGJB7ccsRqWnC6g6RrephXQ9W8RELLKT8ejWxQuVDHl1CZnt8o9wTDTdC4iHvzBEO r5oJNo6erkvehS6V/Hf2otSLzr8LfsX1c30Fr5b6BdKk95+Sfe1BxtiwYQl3bwgDXw aO63S/Asfrh3VHOE6MZqz2RkTxRqImM4xjYI4MO+d8k9t5jat8TdwbOq4zez+N96GI E/E4ia4sVhArYN9Kg4q4bs7/1OZBjWm7uS8HFIqDYGjTTGvbIfcf3cASl8UcSiTd+k 2c5RuggjlFxYihaKE3lCOMCtVhsRuc1oMkRJHjaX3G0b6OOuKw9P/zUivd+w5dnoye 8jwWArFSZX18A== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.1.101] ([213.142.96.134]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MtwYu-1oWB3m11Js-00uIzn; Sat, 28 Jan 2023 16:35:54 +0100 Content-Language: en-US In-Reply-To: <83sffuap62.fsf@gnu.org> X-Provags-ID: V03:K1:hfJstctEu7dXy31Uti+0Tvu3uR07KPOrqsVOYztCWVQIoxe3UBP UuiFlsIiJBScoRu94MmyWwVcWn30aa1osgElgtcSQRX6LX5sGzoVJHxxoUjTsphqMCCt8qW x5C5dCtBRF8hAmu0RKJHLRFmLCb+Qh/w/gdGnUyvMl8wVWDvhz4lwatq7J7QqkL66CUEw+p 4EYZUntlg8xrFFkIHej9Q== UI-OutboundReport: notjunk:1;M01:P0:yxVAhLC5SIA=;bVOfxXmc9b1Ve6gy06Ce+UcqSsU x/ZbbNw2c9EaKUMg/M97KIkFHRZtkov9d+hPYgPw7Jz+jHrtmqzf0eIx2owgHBsH2uAQovA3K gOTM9U6elUYCRS6V5Lvy8cUEvNiwufHd16FBbEj9gY8sZ7O+Mke4zR9fXRfoQmw6mVhCcTlHg gae4D+Z72PULNiSJ3Eg5uHoLsRRGSn8NHVdGf4EZlEBjg2BlF8mZYNAneodYLq16GSA+S7B0i ad/wkPhAegJZmrhqc589pIrqSbAGTkAAuDU9paHOt3UOZKcmEeBJYrOQ9iV12cjH/hEkNqQbL BjlhOvYEm7T0twlrb/BIgoMIY9TnVtWsRUMGLxf3Op9To5SHAEM6ohsgMMZHi5/fwSPiI+4+0 07oiRy8raR56f3FGwE0wJVS/o/F81W707cTvAXWBk6++zhOOyFyX1wwCFRow22k0rXmVGVYZn 9OnrOQ0gYECv2mSLB5L8Eb0K03bQwK6TXeyL7GkaYppaU+8F2QdP1bMRWjgZ+omdlSbkgQrnI mnac72Cvqj+Q+kIX7ncIvhD4oTRkPV0TawRWfDPQZqyJlNfymMxsTt2+zy1UWaLVSwL3McgFd S3QNsd/IRjVOR+6vFv0pgMkgs7yWOOhAcUXgbzvf0SVOVR9JyEdW8YlzX9LcGpo3BtbSjsBxV cCNQ0ON3Rg8Af791HNIMUJ/KYTvtKxECA2Fmdsrd3J5htPn7rGFWJMyUhK0KeVV7TDJpckxP4 ODEafLWidJSth5/J2J3YGDFmqVpcCx8objwXQqxK92yMyRyBkxyM/ZIu9q0OV6hpgcUlcDVi Received-SPF: pass client-ip=212.227.17.20; envelope-from=rudalics@gmx.at; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302719 Archived-At: >> Sorry but I had no idea what 'display-buffer-use-least-recent-window' is >> and what it is supposed to accomplish. > > See bug#45688. You took part in its discussion. I remember. But I never read the code Lars installed including that of 'window-bump-use-time'. I would not have left alone a doc-string saying Display BUFFER in an existing window, but that hasn't been used lately. for example. > I'm not sure what are your recommendations regarding the feature > installed as result of that discussion. Would you mind spelling them > out? Most of it has been said back then in this dialogue: >> This >> >> + (when-let ((window (display-buffer-use-some-window >> + buffer (cons (cons 'inhibit-same-window t) alist)))) >> + (window-bump-use-time window))) >> >> alone will bump the use time for a _reused_ window only. A freshly >> popped up window will continue to be the first candidate for reuse and >> only then enter the cycle of windows to reuse. > > How do we bump the use to for a new window, then? By bumping the time stamp of _any_ window 'display-buffer' uses for displaying a buffer (just like XEmacs does). >> XEmacs treats _all_ windows it creates or uses equal in this regard >> including those on other frames. > > Oh, other frames, too... I think we'll leave that as an exercise for > the reader. Then when you switch from one frame to another, any problems you've found on the previous frame will immediately reemerge on the new frame. We need a way to bump the time stamp of _any_ window used. Otherwise, the various action functions will continue to fight each other. Lars wanted to go the way XEmacs did but stopped in the middle. And XEmacs uses (if (window-buffer window) (save-excursion (save-selected-window (select-window window) (record-buffer (window-buffer window))))) to bump the use time of every window used by 'display-buffer'. > Would it work to just temporarily select the window inside > display-buffer-use-least-recent-window, so that its use time is bumped > without any sneaky primitives? Then we could remove > window-bump-use-time. As Lars conceived it, independent 'display-buffer' calls should be able to build on previous ones. Otherwise, we could write a function like 'display-many-buffers-at-once', within that function mark all windows used as temporarily dedicated to their buffers, and at the end restore the previous dedicated states of these windows. Obviously, a function like 'display-many-buffers-at-once' would not qualify as buffer display action function. martin