[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: split-window-preferred-function
From: |
Juri Linkov |
Subject: |
Re: split-window-preferred-function |
Date: |
Sun, 23 Mar 2008 04:16:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) |
> 2 - provide a non-nil default for split_window_preferred_function
> by moving the current C code that checks the size and calls
> split-window to Elisp.
I tried to follow the current C code as close as possible, and the
result is the function `split-window-preferred-horizontally' below.
It is intended to be set as an option of `split-window-preferred-function'.
Then the other option for it should be nil that will continue the
standard processing of vertical splitting.
There is a comment in cus-start.el that says:
;; FIXME: Add `sensibly' which chooses between
;; vertical or horizontal splits depending on the size
;; and shape of the window.
So `split-window-preferred-sensibly' could be implemented later too
as a similar function.
(defcustom split-width-threshold 100
"A window must be at least this wide to be eligible for splitting
by `display-buffer'. The value is in line units.
If there is only one window, it is split regardless of this value."
:type 'integer
:group 'windows)
(defun split-window-preferred-horizontally (window)
(interactive)
(if (and window
(not (frame-parameter (window-frame window) 'unsplittable))
(window-full-width-p window)
(>= (window-width window) split-width-threshold)
(>= (window-width window) (* 2 window-min-width)))
(split-window window nil 'horiz)
(get-lru-window)))
--
Juri Linkov
http://www.jurta.org/emacs/
- split-window-preferred-function, martin rudalics, 2008/03/19
- Re: split-window-preferred-function, Juri Linkov, 2008/03/20
- Re: split-window-preferred-function, Stefan Monnier, 2008/03/20
- Re: split-window-preferred-function, Juri Linkov, 2008/03/21
- Re: split-window-preferred-function, Stefan Monnier, 2008/03/22
- Re: split-window-preferred-function,
Juri Linkov <=
- Re: split-window-preferred-function, Juri Linkov, 2008/03/27
- Re: split-window-preferred-function, martin rudalics, 2008/03/28
- Re: split-window-preferred-function, Juri Linkov, 2008/03/28
- Re: split-window-preferred-function, martin rudalics, 2008/03/29
- Re: split-window-preferred-function, Juri Linkov, 2008/03/29
- Re: split-window-preferred-function, martin rudalics, 2008/03/29
- Re: split-window-preferred-function, Stefan Monnier, 2008/03/29
- Re: split-window-preferred-function, Richard Stallman, 2008/03/30
Re: split-window-preferred-function, martin rudalics, 2008/03/21