[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Want split-window-vertically to split *vertically*
From: |
Tassilo Horn |
Subject: |
Re: Want split-window-vertically to split *vertically* |
Date: |
Mon, 14 Nov 2011 15:59:40 +0100 |
User-agent: |
Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (gnu/linux) |
"Ludwig, Mark" <ludwig.mark@siemens.com> 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