[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `split-window-preferred-horizontally'
From: |
David Hansen |
Subject: |
Re: `split-window-preferred-horizontally' |
Date: |
Sat, 07 Jun 2008 22:16:45 +0200 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) |
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
- `split-window-preferred-horizontally', David Hansen, 2008/06/06
- Re: `split-window-preferred-horizontally', martin rudalics, 2008/06/06
- Re: `split-window-preferred-horizontally', David Hansen, 2008/06/06
- Re: `split-window-preferred-horizontally', martin rudalics, 2008/06/07
- Re: `split-window-preferred-horizontally',
David Hansen <=
- Re: `split-window-preferred-horizontally', martin rudalics, 2008/06/08
- Re: `split-window-preferred-horizontally', David Hansen, 2008/06/08
- Re: `split-window-preferred-horizontally', David Hansen, 2008/06/09
- Re: `split-window-preferred-horizontally', martin rudalics, 2008/06/10
- Re: `split-window-preferred-horizontally', Stefan Monnier, 2008/06/10
Re: `split-window-preferred-horizontally', Stefan Monnier, 2008/06/06