Skip to content

Proposal to reuse regions for windows of a given type #552

@rmkaplan

Description

@rmkaplan

In our current set up there is no conventional way to prespecify the default region to be used or reused for a window of a given type. Typically, you have to produce a ghost region every time.

The filebrowser is an obvious example: if you do FB *, you have drag out a region. If you close the window and do FB * again, you have to drag out another region. Similarly for SEE and EDIT windows from the filebrowser, and for the Tedit windows that my little lispusers package uses for command-line scrollable PF and SEE. All very clunky.

So here is a proposal: introduce a WINDOWTYPE property on windows. When you open a window with a specified type and don't provide an explicit region, pick a previously used but currently unused region for windows of that type, asking for a new region only if all previous windows are currently in use. Closing a window of a given type will mark its region as available.

This can be done by a simple extension to CREATEW: If the REGION argument is an atom X other than NIL (or if WINDOWTYPE X is on the PROPS list), then assume that X is a type specification and look it up in a global TYPED-WINDOWS-REGIONS list. Then extend CLOSEW so that the region for a window with the WINDOWTYPE property is put back on the list under its type when the window is closed. (Maybe with a submenu on Close that closes all windows of that window's type--clear out all the file browsers or SEE windows with one click)

A user's INIT could initialize TYPED-WINDOWS-REGIONS to a few preferred regions for built-in types, so that typically filebrowser, PF, etc. windows start out in canonical positions without doing the ghost region thing, until a region is needed that is not currently available for that type. The user could turn this behavior on and off for particular types (like FILEBROWSER) by putting a kind of different entry on the regions list.

So: a conservative extension of CREATEW and CLOSEW. Comments?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions