emacs-devel
[Top][All Lists]
Advanced

[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: Sat, 29 Mar 2008 02:45:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu)

> Wouldn't it be nicer to use something like
>
> (or (get-lru-window nil nil)
>     ;; Try visible frames first.
>     (get-buffer-window (current-buffer) 'visible)
>     (get-largest-window 'visible)
>     ;; If that didn't work, try iconified frames.
>     (get-buffer-window (current-buffer) 0)
>     (get-largest-window 0)
>     ;; As a last resort, make a new frame.
>     (frame-selected-window (funcall pop-up-frame-function)))
>
> at the end of `split-window-preferred-horizontally'?

Of course, I already noticed that this part is eligible for optimization
in one `or', but I decided to try writing a close equivalent of
C code in Lisp, so it would be easier to put both versions side-by-side
(in horizontally split windows ;-) and compare their logics.  And I wrote
about this fact in the docstring as:

  This function tries to match the implementation of vertical splitting
  in `display-buffer' as close as possible but with the logic of
  horizontal splitting.

Not a big deal, I think.

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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