From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: Want split-window-vertically to split *vertically* Date: Mon, 14 Nov 2011 15:59:40 +0100 Message-ID: <87r51ada1v.fsf@tsdh.uni-koblenz.de> References: <87vcqmdbjs.fsf@tsdh.uni-koblenz.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1321282825 14833 80.91.229.12 (14 Nov 2011 15:00:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 14 Nov 2011 15:00:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 14 16:00:18 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RPy1B-0002iw-3Q for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Nov 2011 16:00:17 +0100 Original-Received: from localhost ([::1]:51830 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPy1A-0008PX-Pf for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Nov 2011 10:00:16 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:45932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPy11-0008MI-F6 for help-gnu-emacs@gnu.org; Mon, 14 Nov 2011 10:00:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RPy0v-0004kp-8T for help-gnu-emacs@gnu.org; Mon, 14 Nov 2011 10:00:07 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:35897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPy0u-0004kR-Ua for help-gnu-emacs@gnu.org; Mon, 14 Nov 2011 10:00:01 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RPy0p-0002Vg-6y for help-gnu-emacs@gnu.org; Mon, 14 Nov 2011 15:59:55 +0100 Original-Received: from tsdh.uni-koblenz.de ([141.26.67.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Nov 2011 15:59:55 +0100 Original-Received: from tassilo by tsdh.uni-koblenz.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Nov 2011 15:59:55 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 97 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: tsdh.uni-koblenz.de User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (gnu/linux) Cancel-Lock: sha1:t7dtt8oOremJ60NuA6SF1mLuRpY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82909 Archived-At: "Ludwig, Mark" writes: Hi Mark, > Anyway, it turns out that my complaint is with the behavior of > list-matching-lines. It decides to put the *Occur* buffer > side-by-side on wide frames. I reflexively fix that with C-x 0, but > then pressing RET on top of an occurrence invokes > occur-mode-goto-occurrence that also decides to split wide frames > horizontally. Neither function documents any way to influence this > behavior. Is there a way? Ah, now I understand. Have a look at ,----[ C-h v split-window-preferred-function RET ] | split-window-preferred-function is a variable defined in `window.el'. | Its value is split-window-sensibly | | This variable is potentially risky when used as a file local variable. | | Documentation: | Function called by `display-buffer' routines to split a window. | This function is called with a window as single argument and is | supposed to split that window and return the new window. If the | window can (or shall) not be split, it is supposed to return nil. | The default is to call the function `split-window-sensibly' which | tries to split the window in a way which seems most suitable. | You can customize the options `split-height-threshold' and/or | `split-width-threshold' in order to have `split-window-sensibly' | prefer either vertical or horizontal splitting. | | If you set this to any other function, bear in mind that the | `display-buffer' routines may call this function two times. The | argument of the first call is the largest window on its frame. | If that call fails to return a live window, the function is | called again with the least recently used window as argument. If | that call fails too, `display-buffer' will use an existing window | to display its buffer. | | The window selected at the time `display-buffer' was invoked is | still selected when this function is called. Hence you can | compare the window argument with the value of `selected-window' | if you intend to split the selected window instead or if you do | not want to split the selected window. | | You can customize this variable. | | This variable was introduced, or its default value was changed, in | version 23.1 of Emacs. `---- and ,----[ C-h f split-window-sensibly RET ] | split-window-sensibly is a compiled Lisp function in `window.el'. | | (split-window-sensibly WINDOW) | | Split WINDOW in a way suitable for `display-buffer'. | If `split-height-threshold' specifies an integer, WINDOW is at | least `split-height-threshold' lines tall and can be split | vertically, split WINDOW into two windows one above the other and | return the lower window. Otherwise, if `split-width-threshold' | specifies an integer, WINDOW is at least `split-width-threshold' | columns wide and can be split horizontally, split WINDOW into two | windows side by side and return the window on the right. If this | can't be done either and WINDOW is the only window on its frame, | try to split WINDOW vertically disregarding any value specified | by `split-height-threshold'. If that succeeds, return the lower | window. Return nil otherwise. | | By default `display-buffer' routines call this function to split | the largest or least recently used window. To change the default | customize the option `split-window-preferred-function'. | | You can enforce this function to not split WINDOW horizontally, | by setting (or binding) the variable `split-width-threshold' to | nil. If, in addition, you set `split-height-threshold' to zero, | chances increase that this function does split WINDOW vertically. | | In order to not split WINDOW vertically, set (or bind) the | variable `split-height-threshold' to nil. Additionally, you can | set `split-width-threshold' to zero to make a horizontal split | more likely to occur. | | Have a look at the function `window-splittable-p' if you want to | know how `split-window-sensibly' determines whether WINDOW can be | split. `---- Bye, Tassilo -- (What the world needs (I think) is not (a Lisp (with fewer parentheses)) but (an English (with more.))) Brian Hayes, http://tinyurl.com/3y9l2kf