emacs-devel
[Top][All Lists]
Advanced

[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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]