From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Hansen Newsgroups: gmane.emacs.devel Subject: Re: `split-window-preferred-horizontally' Date: Sat, 07 Jun 2008 22:16:45 +0200 Organization: disorganized Message-ID: <8763sl0zma.fsf@localhorst.mine.nu> References: <87k5h28i23.fsf@localhorst.mine.nu> <4849B3D7.6090809@gmx.at> <87fxrq198q.fsf@localhorst.mine.nu> <484A451C.2010408@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1212870217 17948 80.91.229.12 (7 Jun 2008 20:23:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Jun 2008 20:23:37 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 07 22:24:19 2008 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 1K54xW-0003oI-73 for ged-emacs-devel@m.gmane.org; Sat, 07 Jun 2008 22:24:18 +0200 Original-Received: from localhost ([127.0.0.1]:34782 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K54wj-0003sg-2B for ged-emacs-devel@m.gmane.org; Sat, 07 Jun 2008 16:23:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K54we-0003sR-9Q for emacs-devel@gnu.org; Sat, 07 Jun 2008 16:23:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K54wb-0003sF-Rb for emacs-devel@gnu.org; Sat, 07 Jun 2008 16:23:23 -0400 Original-Received: from [199.232.76.173] (port=49489 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K54wb-0003sC-Mc for emacs-devel@gnu.org; Sat, 07 Jun 2008 16:23:21 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:47912 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 1K54wb-0000np-EW for emacs-devel@gnu.org; Sat, 07 Jun 2008 16:23:21 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1K54wV-0000fx-8n for emacs-devel@gnu.org; Sat, 07 Jun 2008 20:23:15 +0000 Original-Received: from e178028044.adsl.alicedsl.de ([85.178.28.44]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Jun 2008 20:23:15 +0000 Original-Received: from david.hansen by e178028044.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Jun 2008 20:23:15 +0000 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 37 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e178028044.adsl.alicedsl.de Mail-Copies-To: nobody User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:0+UWNDeboHHmUk4YL/rhNgVfe5c= X-detected-kernel: by monty-python.gnu.org: 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:98619 Archived-At: On Sat, 07 Jun 2008 10:21:48 +0200 martin rudalics wrote: >> That's how I would like it: >> >> If the *frame* is >= 160 chars wide >> >> - if it is already (horizontally) split use the *other* window with >> all the `*-other-window' commands and `display-buffer' > > `split-window-preferred-function' should decide if and how to split the > largest (or most recently used) window offered by `display-buffer'. It > cannot decide which window to use when _no_ window gets split. But the commands named `*-other' should obviously use some *other* window. Actually the term "other window" is pretty well defined via the command `other-window'. >> - otherwise split it horizontally. >> >> If the *frame* is < 160 chars wide do above with s/horizontally/vertically/ >> (as the default behavior already is). > > (defun my-spf (window) > (if (>= (frame-width (window-frame window)) 120) > (when (window-full-width-p window) > (let ((split-width-threshold 120)) > (split-window window nil t))) > (split-window))) > > seems to do what you want with a value of 120 - I can't test 160 here. (setq split-window-preferred-function #'my-spf) -> Making completion list... if: Attempt to split minibuffer window David