From: Lennart Borgman <lennart.borgman@gmail.com>
To: martin rudalics <rudalics@gmx.at>,
Emacs-Devel devel <emacs-devel@gnu.org>
Subject: Re: moving window handling into lisp
Date: Thu, 20 Aug 2009 17:41:25 +0200 [thread overview]
Message-ID: <e01d8a50908200841n34ebf832va94cd79a6918e27c@mail.gmail.com> (raw)
In-Reply-To: <4A8D66D5.3000600@gmx.at>
On Thu, Aug 20, 2009 at 5:08 PM, martin rudalics<rudalics@gmx.at> wrote:
>>> You should be able to use it for standard cases. For more complicated
>>> cases `adjust-window-trailing-edge' will do its own resizing (and maybe
>>> delete some window along the way). And it's the complicated cases we
>>> have to test.
>>
>> What I wrote is for the most complicated cases. Can you tell me more
>> exactly what you think does not work? You may have seen something I
>> have not seen.
>
> `adjust-window-trailing-edge', as a last consequence, calls size_window
> with nodelete_p zero, so it's allowed to delete windows. I thought you
> wanted to avoid that.
Thanks. I did not know adjust-window-trailing-edge could delete
windows. The doc string does not tell about that. I thought it was
correct. Could you please try to get the doc string corrected to
reflect the functions current state?
>>>>> The first thing we need for each window are some functions like
>>>>> `window-parent-window', `window-prev-window', `window-next-window',
>>>>> `window-vchild', `window-hchild', `window-left-column', and
>>>>> `window-top-line'. This should be simple.
>>>> They are in principle already available through window-tree. But yes,
>>>> having them more explicitly would be fine.
>>> Are you sure? Then you could write the necessary wrappers.
>>
>>
>> Of course I am sure. I am using that in winsav.el. But I do not think
>> it is a good idea to write wrappers on that level. Why do you think
>> that?
>
> If you have the wrappers at hand, use them. We can write these
> functions and think how to call them later.
I do not have them, they are not written in that form. I meant that
the information from Emacs about windows is exposed through
window-tree.
>>>>> Next we need `window-set-new-height' and `window-set-new-width' to set
>>>>> and `window-new-height' and `window-new-width' to get the new values
>>>>> for
>>>>> a window's height and width and a function called
>>>>> `window-set-new-sizes'
>>>>> which copies the new values into the old values (checking whether they
>>>> Maybe. It have to be calculated the way I have said before. Is not
>>>> that clear yet?
>>> But you have to _assign_ these values somehow (unless you try it with
>>> `adjust-window-trailing-edge').
>>
>> But I have said many times that they preferrably should be applied to
>> a whole level at once. That would be much cleaner.
>>
>> What problems do you see with that?
>
> I'm just confused, that's my only problem. You never told me what you
> really want. What does "they preferrably should be applied to a whole
> level at once" mean?
Oh, sorry, then I must have been unclear.
The algorithm computes level by level in the second pass (ie on its
way down) how the windows should be sized. So you have the sizes for
all windows on that level at once. You can of course use
adjust-window-trailing-edge (setting restcrictions temporary to be
able to do that), but it seems much easier to be able to set them all
at once. The routines we have now for setting window sizes does
checking that has already been done by my functions then.
>>>>> But I'm not yet sure how we can integrate the resizing algorithm into
>>>>> `delete-window'. Think of a frame composed of two windows where one is
>>>>> a leaf window and the other a combined window with many subwindows.
>>>>> When deleting the leaf window we have to resize the combined window
>>>>> which means to run a resize algorithm which _must not fail_ to produce
>>>>> a
>>>>> perfectly valid result. So I'm afraid that I do have to run some sort
>>>>> of a rudimentary resize algorithm in C first and apply our algorithm
>>>>> afterwards :-(
>>>> Hm. There must be something you are missing here. Why do you believe
>>>> that my algorithm can't be used. This is exactly a situation where it
>>>> can be used.
>>> When do you call it? If you call it before the window gets deleted,
>>> _you_ have to delete the window (and all its subwindows). If you call
>>> it after the window gets deleted but before the others are resized, the
>>> Elisp call occurs in an invalid window configuration. How would you
>>> handle that?
>>
>>
>> The elisp code I wrote does not in any way care if the configuration
>> is valid or not. It just looks at the available size and the
>> restrictions. Is not that clear? What problem do you see with that?
>
> I can't call Elisp code in an invalid configuration. Suppose your
> algorithm decides that it cannot resize. What shall the display engine
> display then? The invalid configuration?
I am trying to understand what you mean here. You can call my routines
before deletion. It does not depend on the actuall configuration, just
the fictive configuration you tell about.
>>>>> As far as frame-resizing and the necessary deletion of windows is
>>>>> concerned I think we should really run our algorithm and, if it fails,
>>>>> simply delete the least recently used window until it doesn't fail any
>>>>> more (in the worst case this will resize a fixed-size window).
>>>> So you still think we should delete windows? I do not.
>>> If someone eventually comes up with a solution that handles frame
>>> resizing (and minibuffer resizing!) I'll be the first to go for it.
>>
>> I have suggested one. You have not replied to it.
>
> No one ever has suggested a practicable solution. AFAICT you proposed
> to ask the user what to do in that case. That's not practicable IMO.
Not really. I suggested:
- showing an alternate single window with information that the windows
does not fit
- and also keep the other configuration so you can put it back when
the window gets large enough again.
- this should be kept by just swapping a pointer between that single
window with information and the "real" configuration.
What do you find not practical about this? (The alternate single
window should just say something like "your windows does not fit,
please make the frame larger".)
>>>> Did not Stefan say he want to avoid it too?
>>> He did not provide a solution for it - and I suppose he's smart enough
>>> not to propose one.
>>
>> You are misunderstanding him. He wants ideas. Of course he knows about
>> the difficulties.
>
> Stefan earlier said in this thread to
>
> - either somehow make it possible to undelete windows (I'd *much* rather
> not, but maybe if we make it sufficiently restrictive it'd be OK).
> - or maybe avoid deleting the window in this case, instead leave it
> a size-0, and delete it at some later time (when would that be?).
> - prevent frame resizing that would require deleting a window.
>
> and that's where we still are more or less. Everything I heard from
> people since that was not told from an implementor's POV.
Hm. I answered to that that I think it is better to use a single
alternate window like above. That is very much an implementors POV.
Why don't you think it is? (I believe maybe you think so because I do
not adhere to the old routines, but I am not sure.)
I did not go into details, but:
- undeleting seems terribly confusing from a users point of view.
- size-0 windows in a case like this would be the same.
- we probably can't prevetn resizing with all window managers.
>>>> Did you seriously try to understand my suggestion for how to handle it?
>>> Did you have a serious suggestion?
>>
>> Yes.
>>
>> Martin, can I take this to the list again. I thought we would save
>> time this way, but I am starting to doubt it. Can I send this mail to
>> the list?
>
> Sure, go ahead ;-)
Ok, done. It took it off list since I thought we should discuss boring
details, but the got back to principal discussion again so here we are
on the list again!
> martin
>
next prev parent reply other threads:[~2009-08-20 15:41 UTC|newest]
Thread overview: 130+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-27 8:32 moving window handling into lisp Miles Bader
2009-07-27 13:37 ` martin rudalics
2009-07-27 13:41 ` Lennart Borgman
2009-07-27 13:45 ` martin rudalics
2009-07-27 13:58 ` Lennart Borgman
2009-07-27 14:35 ` martin rudalics
2009-07-27 14:41 ` Lennart Borgman
2009-07-27 15:02 ` martin rudalics
2009-07-27 15:28 ` Lennart Borgman
2009-07-27 16:52 ` martin rudalics
2009-07-27 16:58 ` Lennart Borgman
2009-07-27 18:18 ` Stefan Monnier
2009-07-28 7:38 ` martin rudalics
2009-07-28 9:39 ` Lennart Borgman
2009-07-28 12:25 ` martin rudalics
[not found] ` <e01d8a50907280532kcff2d1w15567a430668a502@mail.gmail.com>
2009-07-28 13:23 ` martin rudalics
2009-07-28 13:44 ` Lennart Borgman
2009-07-29 9:04 ` martin rudalics
2009-07-28 13:47 ` Stefan Monnier
2009-07-28 14:11 ` Lennart Borgman
2009-07-29 9:05 ` martin rudalics
2009-07-29 14:05 ` Stefan Monnier
2009-08-01 2:20 ` Miles Bader
2009-08-03 21:29 ` Stefan Monnier
2009-08-11 9:18 ` martin rudalics
2009-08-11 19:16 ` Stefan Monnier
2009-08-11 19:29 ` Lennart Borgman
2009-08-12 8:57 ` martin rudalics
2009-08-12 9:02 ` Lennart Borgman
2009-08-12 13:33 ` martin rudalics
2009-08-12 15:57 ` Lennart Borgman
2009-08-12 17:05 ` martin rudalics
2009-08-12 19:39 ` Lennart Borgman
2009-08-12 21:10 ` Lennart Borgman
2009-08-13 9:55 ` martin rudalics
2009-08-13 9:57 ` Lennart Borgman
2009-08-13 10:25 ` Lennart Borgman
2009-08-13 11:32 ` Lennart Borgman
2009-08-13 12:49 ` Lennart Borgman
2009-08-13 13:56 ` martin rudalics
2009-08-13 16:43 ` Lennart Borgman
2009-08-13 18:07 ` martin rudalics
2009-08-14 1:13 ` Lennart Borgman
2009-08-14 7:18 ` martin rudalics
2009-08-14 11:21 ` Lennart Borgman
2009-08-14 13:21 ` martin rudalics
2009-08-12 8:56 ` martin rudalics
2009-08-13 2:32 ` Stefan Monnier
2009-08-13 9:54 ` martin rudalics
2009-08-13 17:00 ` Stefan Monnier
2009-08-13 18:09 ` martin rudalics
2009-08-14 1:47 ` Stephen J. Turnbull
2009-08-14 7:17 ` martin rudalics
2009-08-14 6:42 ` Richard Stallman
2009-08-14 7:18 ` martin rudalics
2009-08-14 20:56 ` Richard Stallman
2009-08-15 10:12 ` martin rudalics
2009-08-15 19:47 ` Stefan Monnier
2009-08-14 15:39 ` Stefan Monnier
2009-08-14 15:42 ` Lennart Borgman
2009-08-14 18:26 ` Stefan Monnier
2009-08-15 10:12 ` martin rudalics
2009-08-15 11:02 ` Lennart Borgman
2009-08-15 12:44 ` martin rudalics
2009-08-15 13:35 ` David Kastrup
2009-08-15 13:39 ` Lennart Borgman
2009-08-15 16:11 ` martin rudalics
2009-08-15 16:19 ` Lennart Borgman
2009-08-15 17:37 ` martin rudalics
2009-08-15 18:18 ` Lennart Borgman
2009-08-16 10:25 ` martin rudalics
2009-08-16 11:14 ` Lennart Borgman
2009-08-16 12:12 ` David Kastrup
2009-08-16 12:19 ` Lennart Borgman
2009-08-16 15:17 ` martin rudalics
2009-08-16 16:15 ` David Kastrup
2009-08-16 19:24 ` martin rudalics
2009-08-16 12:17 ` martin rudalics
2009-08-16 12:26 ` Lennart Borgman
2009-08-16 15:18 ` martin rudalics
2009-08-15 19:05 ` Stephen J. Turnbull
2009-08-16 10:26 ` martin rudalics
2009-08-16 11:16 ` Lennart Borgman
2009-08-16 12:17 ` martin rudalics
2009-08-16 12:29 ` Lennart Borgman
2009-08-16 15:18 ` martin rudalics
2009-08-16 14:49 ` Stephen J. Turnbull
2009-08-16 15:31 ` martin rudalics
2009-08-16 16:28 ` Stephen J. Turnbull
2009-08-16 19:25 ` martin rudalics
2009-08-15 15:07 ` Jan Djärv
2009-08-15 15:38 ` David Kastrup
2009-08-15 16:07 ` martin rudalics
2009-08-15 18:21 ` Stephen J. Turnbull
2009-08-16 10:25 ` martin rudalics
2009-08-15 19:51 ` Stefan Monnier
2009-08-16 10:26 ` martin rudalics
2009-08-16 11:18 ` Lennart Borgman
2009-08-16 12:17 ` martin rudalics
2009-08-16 12:30 ` Lennart Borgman
2009-07-27 14:00 ` Miles Bader
2009-07-27 14:36 ` martin rudalics
[not found] ` <4A87F8B8.6050102@gmx.at>
[not found] ` <e01d8a50908160523r12216cffm34060d2793943785@mail.gmail.com>
[not found] ` <4A882312.6020106@gmx.at>
[not found] ` <e01d8a50908191816p2d9e978dw6aa0623c79dd8699@mail.gmail.com>
[not found] ` <4A8D12B3.6070502@gmx.at>
[not found] ` <e01d8a50908200219o69f67900lb9fa9368e9aadf62@mail.gmail.com>
[not found] ` <4A8D46C9.1010108@gmx.at>
[not found] ` <e01d8a50908200622y101e5b2bq9fb5874cbb8c81fe@mail.gmail.com>
[not found] ` <4A8D66D5.3000600@gmx.at>
2009-08-20 15:41 ` Lennart Borgman [this message]
2009-08-20 18:15 ` martin rudalics
2009-08-20 23:08 ` Lennart Borgman
2009-08-21 12:40 ` martin rudalics
2009-08-21 13:58 ` Lennart Borgman
2009-08-22 11:00 ` martin rudalics
2009-08-22 13:45 ` Lennart Borgman
2009-08-22 14:17 ` martin rudalics
2009-08-21 19:34 ` Stefan Monnier
2009-08-22 11:01 ` martin rudalics
2009-08-21 0:19 ` Richard Stallman
2009-08-21 12:40 ` martin rudalics
-- strict thread matches above, loose matches on Subject: below --
2009-08-17 19:06 grischka
2009-08-18 7:13 ` martin rudalics
2009-08-18 11:38 ` Lennart Borgman
2009-08-19 9:15 ` grischka
2009-08-19 12:45 ` martin rudalics
2009-08-20 11:45 ` grischka
2009-08-20 12:51 ` martin rudalics
2009-08-20 13:05 ` David Kastrup
2009-08-20 15:08 ` martin rudalics
2009-08-20 19:35 ` grischka
2009-08-21 12:22 ` martin rudalics
2009-08-21 19:32 ` Stefan Monnier
2009-08-22 4:55 ` Stephen J. Turnbull
2009-08-23 1:01 ` Stefan Monnier
2009-08-24 13:10 ` grischka
2009-08-19 13:01 ` Lennart Borgman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e01d8a50908200841n34ebf832va94cd79a6918e27c@mail.gmail.com \
--to=lennart.borgman@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=rudalics@gmx.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.