From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#3366: 23.0.94; doc of split-window-preferred-function, display-buffer, etc. Date: Mon, 25 May 2009 01:42:40 -0700 Message-ID: <779632281BA742BFB5A1470D08B17538@us.oracle.com> References: <7BFD115BD21E4677AAB801DA5EBBFED1@us.oracle.com> <4A1A42F9.7050500@gmx.at> Reply-To: Drew Adams , 3366@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1243242632 4320 80.91.229.12 (25 May 2009 09:10:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 May 2009 09:10:32 +0000 (UTC) To: "'martin rudalics'" , <3366@emacsbugs.donarmstrong.com> Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 25 11:10:25 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1M8WCO-0001Cf-7T for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 May 2009 11:10:25 +0200 Original-Received: from localhost ([127.0.0.1]:42304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M8WCN-0005dW-Ig for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 May 2009 05:10:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M8WBM-0005Bc-HG for bug-gnu-emacs@gnu.org; Mon, 25 May 2009 05:09:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M8WBG-00058J-Q6 for bug-gnu-emacs@gnu.org; Mon, 25 May 2009 05:09:19 -0400 Original-Received: from [199.232.76.173] (port=46526 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M8WBG-000585-G2 for bug-gnu-emacs@gnu.org; Mon, 25 May 2009 05:09:14 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:60387) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M8WBF-0000rk-Ui for bug-gnu-emacs@gnu.org; Mon, 25 May 2009 05:09:14 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n4P99BXb023610; Mon, 25 May 2009 02:09:11 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n4P8o3CB020214; Mon, 25 May 2009 01:50:03 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: "Drew Adams" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 25 May 2009 08:50:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3366 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 3366-submit@emacsbugs.donarmstrong.com id=B3366.124324095719430 (code B ref 3366); Mon, 25 May 2009 08:50:03 +0000 Original-Received: (at 3366) by emacsbugs.donarmstrong.com; 25 May 2009 08:42:37 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from acsinet11.oracle.com (acsinet11.oracle.com [141.146.126.233]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n4P8gWgb019425 for <3366@emacsbugs.donarmstrong.com>; Mon, 25 May 2009 01:42:34 -0700 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by acsinet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n4P8gxoh010602 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 25 May 2009 08:43:00 GMT Original-Received: from abhmt004.oracle.com (abhmt004.oracle.com [141.146.116.13]) by acsinet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n4P8h8ZN016294; Mon, 25 May 2009 08:43:08 GMT Original-Received: from dradamslap1 (/98.210.250.59) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 25 May 2009 01:42:21 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <4A1A42F9.7050500@gmx.at> Thread-Index: AcndB/FSJSYuVYA6RbiEvMw1fZtJbwADA3qw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: abhmt004.oracle.com [141.146.116.13] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A09020A.4A1A59EE.010D:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Mon, 25 May 2009 05:09:19 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:28143 Archived-At: > > It seems (but I'm not sure this works for all cases) that what is > > needed, to ensure that the same window as before is split, > > is to bind `split-window-preferred-function' to something like > > this around calls to `display-buffer': > > (lambda (w) (eq w (get-lru-window))) > > The function you want might be > > (defun split-window-22 (window) > (let ((frame (window-frame window))) > (or (and (setq window (get-largest-window frame t)) > (window-full-width-p window) > (window-splittable-p window) > (split-window window)) > (and (setq window (get-lru-window frame t)) > (window-splittable-p window) > (split-window window))))) > > but I wouldn't rely on it. Thanks for this info, Martin. For the particular code I had in mind the simpler version I wrote above works, but I understand the difference. > > Even if this function is not an exact recipe for all > > cases, something like it should be mentioned, to help users > > get back the behavior that existed before the new "smarter" > > behavior was introduced. Preferably, Emacs would itself provide > > a function that users could use here - a function that would > > give precisely the pre-23 behavior in all cases. > > > > We should also make it clear that if you want the pre-23 > > behavior then you will need to wrap not only explicit calls to > > `display-buffer' with a `let' binding this way, but also calls > > to things such as `with-output-to-temp-buffer'. > > All people have to do is customize > `split-window-preferred-function' to that function. No, I'm talking about code, not a broad user preference setting. Code that wants, for example, to work with various releases. But yes, that's my point: We should tell users that they can bind `split-window-preferred-function' to such a function to get Emacs 22/21/20 behavior wrt window splitting. I suggest we provide such a function, and mention it in the doc string. If the function you wrote above isn't perfect, it's still probably pretty good. Bug reports will help perfect it, if need be.