From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: Patch: prefer-window-split-horizontally Date: Thu, 16 Aug 2007 16:37:34 +0200 Message-ID: <87zm0rwno1.fsf@baldur.tsdh.de> References: <87bqdajcr1.fsf@baldur.tsdh.de> <87vebij5p8.fsf@jurta.org> <877inwvakl.fsf@baldur.tsdh.de> <873ayk0z9b.fsf@baldur.tsdh.de> <874pizy4y6.fsf@baldur.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1187275081 7226 80.91.229.12 (16 Aug 2007 14:38:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Aug 2007 14:38:01 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 16 16:37:55 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ILgTz-0002Nl-6m for ged-emacs-devel@m.gmane.org; Thu, 16 Aug 2007 16:37:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ILgTy-0001MF-Ko for ged-emacs-devel@m.gmane.org; Thu, 16 Aug 2007 10:37:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ILgTv-0001M0-FJ for emacs-devel@gnu.org; Thu, 16 Aug 2007 10:37:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ILgTu-0001Lo-UB for emacs-devel@gnu.org; Thu, 16 Aug 2007 10:37:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ILgTu-0001Ll-Sa for emacs-devel@gnu.org; Thu, 16 Aug 2007 10:37:50 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ILgTu-0003g0-Ak for emacs-devel@gnu.org; Thu, 16 Aug 2007 10:37:50 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1ILgTq-0001yU-Dr for emacs-devel@gnu.org; Thu, 16 Aug 2007 16:37:46 +0200 Original-Received: from dslb-084-063-052-102.pools.arcor-ip.net ([84.63.52.102]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Aug 2007 16:37:46 +0200 Original-Received: from tassilo by dslb-084-063-052-102.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Aug 2007 16:37:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 67 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: dslb-084-063-052-102.pools.arcor-ip.net Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAD1BMVEU8PDyjo6P5+fm+v8F/ gIO4imEzAAAACXBIWXMAAArrAAAK6wGCiw1aAAAATnRFWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYA CmV4aWYKICAgICAgMjAKNDU3ODY5NjYwMDAwNGQ0ZDAwMmEwMDAwMDAwODAwMDAwMDAwMDAwMAqJ uBZbAAAACXZwQWcAAAAwAAAAMADO7oxXAAABnklEQVQ4y6WU0YGDIAyGozIAFAY4iAM0iQNAZf+Z LkBrr1f7cseDIp8JyZ8ApA8D/gaiI/9cQne5A6wAcJCYwcwdIEEbbqyH/tGBZHjZ6apgbuALgF/2 XQfArK826CB5gGGA3gUNr9taMApkGLQIbIYeatRNQVcaiBbgCG6ADRadu77aqJo07w3M3W0bdQIo /a+HBQ4/pT1Y/2pRhZaeNTsRBTvlAlPMD6C+kS2UIEvZN7hnHsckwkT+koyjh1ZxTK5QZPdozEWl W7qIum60CJVMIcnGX7um0DWbVIy6Wc+ca6WeGHTNluTIiBNJa65yO0oLN/Q0sTAjglExj2ZglOvC CZNgzvUHQJE8tSIThzTqcy+qBFN6TTz9bB+kAE5rtBo2ifkJKM+roIK8EOPlAGg1GWFJuAEz3V5a tAHxuDmXf/WuZ4w7Ct1b5gmcYJo1ujcQVahNMxf7+xgUlnXHYOYTwMGY/HZwnIalnuobiF4VoxOL VCQ++vsVRKfBLmfA+O3UIgXv8ilIJcD5OQ92PgcrfLgZvvKnK2P9zyXzDWhiiUxowX0ZAAAAGnpU WHRqcGVnOmNvbG9yc3BhY2UAAHjaMwIAADMAM4k4IzUAAAAmelRYdGpwZWc6c2FtcGxpbmctZmFj dG9yAAB42jOqMNIxrDAEYQARgwLpPZcvTwAAAABJRU5ErkJggg== User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:hp3MCTCuSQHzopNG8JH4cpeUa84= X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:76631 Archived-At: writes: Hi Klaus, >>> If all/most current callers of this function would rather have it >>> stay the way it is and if all callers that want it changed do not >>> call it directly (or call it interactively), then we're better off >>> changing the other place where split-window is called (i.e. >>> display-buffer) or creating a new function. >> >> I cannot follow you completely. In most cases it's not the caller >> who should decide how windows are split but the user, who wants to >> use his screen as good as possible. >> >> Beside Gnus and ECB I don't know any packages that have to care of >> how windows have to be split. And at least for Gnus I can say that >> it does the split using all params `split-window' has, and thus >> `split-window-function' wouldn't be used. > > If it's usefull for you, i can check this for ECB - can you please > repeat exactly what i have to check! Then i can do this at weekend... I suggested to change `split-window' so that it splits in a way the user can configure by setting `split-window-function' to a function that returns a symbol naming a function that should do the split, if and only if split-window is called with zero or one (the WINDOW) argument. So calls to `split-window' that rely on the current behavior (that the split will be vertically) are forced to use the additional parameters. So if ECB relies on the current behavior, calls like (split-window window) might not do what you expect if the user configured `split-window-function'. I grepped ECB's code and there are at least 4 places that would need to be adapted. ./ecb-layout.el:2213: (setq window (split-window window)) ./ecb-layout.el:2227: (setq window (split-window window))) ./ecb-layout.el:2955: (split-window (car (ecb-canonical-edit-windows-list))))) ./ecb-layout.el:2991: (split-window (car edit-win-list))))) ./ecb-layout.el:3757: (call-interactively 'split-window))) BTW: I see a problem with my approach. I guess in elisp the calls (split-window window) and (split-window window nil nil) are equal and you cannot distinguish if nil was given explicitly or not, right? So maybe the HORFLAG argument should be changed to FLAG with possible values 'horizontal and 'vertical, defaulting to 'horizontal. I guess that wouldn't break most current packages, because you normally wouldn't give all args if they're nil. Of course, calls like (split-window window size (want-horiz)) where the FLAG is calculated would need to be checked. Bye, Tassilo