|
From: | Lennart Borgman (gmail) |
Subject: | Re: MY window tree! |
Date: | Mon, 15 Jan 2007 14:07:37 +0100 |
User-agent: | Thunderbird 1.5.0.9 (Windows/20061207) |
martin rudalics wrote:
> Saving and restoring properties is rather straightforward. Is there > still any reason to have this in C? I don't care about things like `buffer-display-count' or `use_time', hence I wouldn't know. I would care, however, about the following: (1) You do (newovl (make-overlay start end))) but you never delete any overlays AFAICT. Doesn't this mean to get _two_ overlays (whose properties are mostly identical but for the window-property) in the same place? What's so problematic about simply changing the window-property of each affected overlay to "window"?
Then the old window that the overlay 'window property pointed to no longer exists there are no problem, but if it does then I think it is best to copy the overlay. I have changed the code to do distinguish those two cases now.
See also the comment in Bugs and limitation that I have added to winsav.el now.
(2) The adjusting part doesn't work here yet, that is all windows are balanced in their heights and widths. I don't understand the code yet but I can't imagine that it should be necessary to round the size of all windows, leaf windows should be left alone, I presume. (BTW new-height, new-size, ..., old-width would be more readable.) I tried with trivial code like (let ((tree (winsav-get-window-tree))) (delete-other-windows) (winsav-restore-window-tree tree (split-window (selected-window) nil t)))
Resizing is a bit harder than one think at the beginning. I forgot that it must be done iteratively. I have added that now, please try again.
(3) I don't understand yet what happens when a particular window can't be split because it's too small.
I had not try taken care of that problem before. I have tried to do that now.
(4) I think `window-start' should be preserved unless this would make `window-point' disappear.
Seems reasonable. I have tried to fix it.
(5) A hook which passes old / new window arguments for each pair where a change took place would be urgently needed.
I do not see where to put in the hook. Maybe returning a list of window pairs ((old new) ...) would do what you want?
[Prev in Thread] | Current Thread | [Next in Thread] |