unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Want split-window-vertically to split *vertically*
Date: Mon, 14 Nov 2011 15:59:40 +0100	[thread overview]
Message-ID: <87r51ada1v.fsf@tsdh.uni-koblenz.de> (raw)
In-Reply-To: BC5672F8AD4C054BAF167C9801500D1A6FBD6DCF@USSLMMBX003.net.plm.eds.com

"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




  reply	other threads:[~2011-11-14 14:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-14 14:01 Want split-window-vertically to split *vertically* Ludwig, Mark
2011-11-14 14:27 ` Tassilo Horn
2011-11-14 14:51   ` Ludwig, Mark
2011-11-14 14:59     ` Tassilo Horn [this message]
2011-11-14 15:41 ` FreeHCK
     [not found] <mailman.14705.1321279291.797.help-gnu-emacs@gnu.org>
2011-11-14 16:51 ` Jonathan Oddie
2011-11-14 20:14   ` Peter Dyballa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r51ada1v.fsf@tsdh.uni-koblenz.de \
    --to=tassilo@member.fsf.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).