>>>> "Stephen" == Stephen J Turnbull
<stephen(a)xemacs.org> writes:
>>>> "Klaus" == Klaus Berndl <Berndl>
writes:
Klaus> If i understand the function window-list right it should return a
Klaus> window-list in that order `other-window', `walk-windows' or
Klaus> `next-window' would return/ Move?! Is my understanding right?
Stephen> The documentation says "a list." No promise about order
Stephen> (except that the specified window comes first), no mention of
Stephen> the other functions.
Stephen's right.
Yes, indeed, i admit
Klaus> If not then i would vote for that order!
Stephen> Why? It seems to me that if you have an application that wants
Stephen> to walk through the windows in `walk-windows' order it should
Stephen> use `walk-windows'. Keeping a list around and depending on its
Stephen> order to be correct later is just asking for trouble.
Stephen> In any case, if you're going to make this change you need to
Stephen> fix the documentation of window-list and walk-windows at least
Stephen> to specify that they give the same order, and maybe what that
Stephen> order is.
I don't think this is the right approach for a function called
only
`window-list.' If you need this kind of functionality, you should
simply add a new function that's called `window-list-in-next-order.'
Not that I think *this* would be particularly useful: If you need to
traverse the windows according to some order, it's probably a better
idea to do so explicitly.
No, here i do not agree with you and Stephen. Reasons:
- Changing current `window-list' so it always returns a somehow canonical
ordered list is very simple and has really no disadvantage (at least as fas
i can see)
- A window list is not only for walking through the windows of this list (for
this task `walk-windows' is indeed the right and better function. But sometimes
i want to get the current-window-list of a frame, save it and use it later (maybe
comparison or something else). I think you can not progose for which jobs a
programmer could use the result of `window-list' and maybe some of these jobs could
profite from the fact that the ordering of the result list is known. Currently it
is undefined (i mean the order of the list is always the same but the docu does
not say anything about the order!)
- Just that i can rely, that `other-window', `next-window', walk-windows'
and `window-list' always operate/return (on) the windows in the same order is IMHO
a valuable fact even it is just for consistency.
I really not understand, why my suggestion to make `window-list' returning a defined
order (and then why not using the "canonical" order of some other
window-functions?!)
runs against you, because the change is very simple and has really no side-effects for
existing code (because existing code is not allowed to be based on any order of the
result list, because there is no defined order like Stephen says right) and also
has no other disadvantages (or can you tell me any?).
Ciao,
Klaus