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: Fri, 07 May 2010 21:14:43 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu)

> Perhaps then I am an android.  I look at that code and it takes me quite a
> while to decide that the window-tree it produces (as I defined it) is (I
> think)
>
> (nil #<methods> 0.15 #<sources> 0.3 (t #<history> 0.5 #<directories>))

The problem is that the internal structure with the window configuration
is a list.  So when exposed to Lisp, it should be a Lisp list.

It you want a tree, it's possible to write a Lisp function
that converts a window list to a window tree, e.g.

  (window-configuration-to-tree
    (window-configuration-to-list
      (current-window-configuration)))

where `window-configuration-to-list' is a C function that
exposes #<window-configuration> to Lisp as a list like

  (window-configuration
   (frame-cols . 194)
   (frame-lines . 77)
   (root-window . #<window 16>)
   (windows
     (window
      (window . #<window 16>)
      (left-col . 0)
      (top-line . 5)
      (total-cols . 200)
      (total-lines . 71))
     (window
      (window . #<window 3 on *scratch*>)
      (parent . 0)
      (left-col . 0)
      (top-line . 5)
      (total-cols . 100)
      (total-lines . 71))
     (window
      (window . #<window 18>)
      (parent . 0)
      (prev . 1)
      (left-col . 100)
      (top-line . 5)
      (total-cols . 100)
      (total-lines . 71))
     (window
      (window . #<window 17 on *info*>)
      (parent . 2)
      (left-col . 100)
      (top-line . 5)
      (total-cols . 100)
      (total-lines . 35))
     (window
      (window . #<window 19 on *Messages*>)
      (parent . 2)
      (prev . 3)
      (left-col . 100)
      (top-line . 40)
      (total-cols . 100)
      (total-lines . 36))
     (window
      (window . #<window 4 on  *Minibuf-0*>)
      (prev . 0)
      (left-col . 0)
      (top-line . 76)
      (total-cols . 200)
      (total-lines . 1))))

and `window-configuration-to-tree' is a Lisp function that converts it
to a window-tree.

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




reply via email to

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