Fix Tedit promptwindow overlap when given a title-less window #2375
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes sure that the promptwindow is attached as the last thing when a window is set up for a Tedit document. This also ensures that Tedit windows always have titles.
If a title-less window (as opposed to a region or NIL) is given as the WINDOW argument to TEDIT or OPENTEXTSTREAM, a title is constructed and installed first, before the prompt window is attached.
This should eliminate the odd behavior reported in #2363.
However, Tedit windows are not guaranteed to be subtractive, in the sense discussed there, so the title and/or promptwindow may show up above the region provided by the user. There is a conceptual confusion as to whether what the user specifies is the region of the final window constellation (with title and promptwindow) or the region of the text area of the window (the clipping region without title or promptwindow). The former is subtractive, the latter is additive.
This interacts with the heuristics for suggesting a default size for a window based on properties of the document that it is going to display--those heuristics calculate the text region, assume an additive model.