emacs-devel
[Top][All Lists]
Advanced

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

Re: Window configurations


From: Juri Linkov
Subject: Re: Window configurations
Date: Wed, 28 Apr 2010 11:35:33 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu)

> Why not store a configuration as a (resolution-independent) tree:
>
> subtree = window | tree ;
> tree = "(", horiz, subtree, split, { split }, ")" ;
> split = fraction, subtree ;
> horiz = nil | t ;            (* t for C-x 3 *)
> fraction = ? float ? ;
> window = ? ... ? ;           (* the hard part *)
>
> very much like (window-tree)?

A window-tree format is good for androids.  But for human beings it is
too complicated.  Please see how ECB defines window configurations as
a plain list of function calls because it is more simple and convenient
for human users:

  (ecb-set-directories-buffer)
  (ecb-split-ver 0.3)
  (ecb-set-sources-buffer)
  (ecb-split-ver 0.5)
  (ecb-set-methods-buffer)
  (select-window (previous-window))
  (ecb-split-hor 0.5)
  (ecb-set-history-buffer)

But this format has one drawback - it is procedural.

Using a declarative, more general and future-proof format:

  (window A
    (buffer . A))
  (window B
    (buffer . B)
    (left-window . A))
  (window C
    (buffer . C)
    (top-window . A))
  (window D
    (buffer . D)
    (top-window . B)
    (left-window . C))

will create

  +-+-+
  |A|B|
  +---+
  |C|D|
  +-+-+

and with a different order of window definitions:

  (window A
    (buffer . A))
  (window C
    (buffer . C)
    (top-window . A))
  (window B
    (buffer . B)
    (left-window . A))
  (window D
    (buffer . D)
    (top-window . B)
    (left-window . C))

will create

  +-+-+
  |A|B|
  +-|-+
  |C|D|
  +-+-+

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




reply via email to

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