[Top][All Lists]

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

Re: read syntax for window configs

From: martin rudalics
Subject: Re: read syntax for window configs
Date: Fri, 19 Mar 2010 14:07:32 +0100
User-agent: Thunderbird (Windows/20090302)

>> Thank you for posting this.  It won't work out of the box for Emacs
>> because Emacs lacks `make-window-configuration' and `make-saved-window'.
>> Can you post their definitions here or tell us a page on the net where
>> we can look at them?
> http://hg.debian.org/hg/xemacs/xemacs/file/45753d9a0dc4/lisp/window-xemacs.el

Sorry but this has only a call to `make-window-configuration' in
`current-window-configuration'.  I've been looking into window.c but
didn't find it there either :-( I suppose it simply builds a vector from
its arguments.

>> Do they check a configuration for integrity (e.g., whether the
>> combined window sizes match those of their parents, that of the root
>> window the size of the frame, ...) before mapping the frame?
> Yes: Since all restoration happens from Lisp, there's no way to get
> anything inconsistent.

Well, if something happens in Elisp there's always a chance that things
get messed up on the fly.  I'd very much prefer to do the elementary
checks (those that prevent Emacs from crashing or showing distorted
frames) only in C.

>> Can you restore on machine A a configuration saved on machine B when A
>> and B have different toolkits?
> I don't see why not.  You're not always going to get an
> identical-looking configurations because the original frame will be
> gone, but as close an approximation as the code knows how to recreate.

OK.  So I presume your code handles the case where window sizes don't
fit because, for example, toolbars or scrollbars have different widths.

>> Also, am I right that the `next-child' field denotes the right sibling
>> of the window?
> If I recall correctly, it depends on whether windows are going right or
> down.  It's just whatever `window-next-child' returns on XEmacs.

I've checked that.  It _is_ the right sibling and it doesn't depend on
whether windows go right or down (obviously, when windows go down the
right sibling denotes the window below).

>> And, how do you translate back from pixel values (like `pixel-left'
>> ... ) to normal line/column values?  Do you?
> No, we don't.

That's good (but momentarily not suitable for Emacs).  You apparently do
all these calculations via window_pixel_height_to_char_height /
window_char_height_to_pixel_height and friends.  And it will allow to
fix any of the scroll- or toolbar problems I mentioned above by giving
the remaining pixels to one of the involved windows.

Emacs should eventually do something similar ;-)

> I don't know anything about ECB, so I don't really know.  However, I
> would think that it needs to remember the name of the buffer to find the
> window, or remember the window's place in the layout.  (That's a general
> issue with window configurations, but it becomes very clear here -
> there's no way to preserve window identity across sessions.)

Funnily, nothing would prevent us from keeping window identities across
sessions.  If and only if a saved configuration is restored _before_ the
first user interaction.  Well we could check whether a window with such
an identity exists already but I wouldn't like that ...

Thanks again, martin

reply via email to

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