emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: split-window-preferred-function


From: martin rudalics
Subject: Re: split-window-preferred-function
Date: Sat, 05 Apr 2008 17:42:38 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> I don't think that tuning the split-window concept will bring you
> any further. Such function is simply too low-level than that it
> could do what you want, that is to create new layout on-the-fly.

Here we are mostly concerned with using `split-window' for displaying a
buffer currently not present on the frame.  In particular we are
concerned with picking the optimal window to split and the optimal way
to split it.  While this will get us a new layout I wouldn't call it
"creating" a new layout.

> So why don't you let the user define the layout and make the code
> fill in the options. Where LAYOUT means what (class of) content
> shall be shown in what place, and OPTIONS for instance can mean
> what do do with space where the content is currently not available.
>
> Have a look at elscreen.  Or think about html div tags, they define
> layout that only applies if there is content.

IIUC elscreen is useful for switching between existing layouts.  Such
layouts are obtained by recursively splitting a root window horizontally
or vertically.  You can record such a layout in volatile memory by
calling `current-window-configuration' and you can re-create it from
there via `set-window-configuration'.  But you cannot (easily) define
and subsequently create such a layout manually.  Hence elscreen seems
hardly of any help in this context.  Please correct me if I'm wrong.

I can think of two options:

1. Make the underlying window structure accessible in Elisp - via
   parameters or functions like `window-parent' and `set-window-parent'.
   This would require careful design of things like `set-window-parent'
   to avoid introducing incoherent or faulty window layouts via Elisp.

2. Write a collection of functions that recursively tile a root window
   in some well-defined manner according to rules that humans can easily
   write, read and understand.  Maybe some of these layouts should be
   depicted in a graphical fashion, for example, in the toolbar (my
   Thunderbird permits me to choose among three basic tilings).





reply via email to

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