Skip to content

Conversation

@rmkaplan
Copy link
Contributor

Clients can inject additional processing between getting and registering a region

If a window is closed whose region is of an as-yet-unknown type, a new entry will be added implicitly to TYPED-REGIONS to that that region and future regions of that type can be recycled.
…d-region is also reshaped for reuse

Also, the typed-region of a window is pushed on the front of the TYPED-REGIONS list when the window is closed, so the most recent region of that type will be used the next time.  Recency seems more intuitive than primacy
@masinter masinter force-pushed the rmk82--REGIONMANAGER-cleanup branch from 2f5fa64 to caa0546 Compare October 18, 2023 14:25
Copy link
Member

@masinter masinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the one hand, this is "just LISPUSERS" and optional. But if we're going to bring this into standard practice, checking against other Lispusers packages
(TILED-SEDIT?) and Rooms. And, for everyone but especially for online users, readjusting window regions when reshaping the screen size (currently you do this by (LOGOUT) and then restarting).

@masinter masinter changed the title Expose useful subfunctions Expose useful subfunctions in REGIONMANAGER Oct 18, 2023
@masinter masinter merged commit fbb5a8f into master Oct 18, 2023
@masinter masinter deleted the rmk82--REGIONMANAGER-cleanup branch October 18, 2023 14:38
@rmkaplan
Copy link
Contributor Author

rmkaplan commented Oct 18, 2023 via email

@masinter
Copy link
Member

My comment was about REGIONMANAGER and whether or not it introduces any incompatibilities with older region management Lispusers packages that aren't normally loaded. How would we know?

@rmkaplan
Copy link
Contributor Author

rmkaplan commented Oct 20, 2023 via email

@masinter
Copy link
Member

medley/rooms/ROOMS-WINDOW-HIDER contains an (ADVISE ATTACHWINDOW)
while REGIONMANAGER avoids an ADVISE but is trying to do the equivalent by
(P (MOVD? 'ATTACHWINDOW 'ATTACHWINDOW.ORIG)
(MOVD 'RM-ATTACHWINDOW 'ATTACHWINDOW))

I'm pretty sure the behavior will be different depending on the order of loading.

@rmkaplan
Copy link
Contributor Author

rmkaplan commented Oct 21, 2023 via email

@masinter
Copy link
Member

I don't like ADVICE anywhere, because of (UNADVISE) -- it's useful while debugging and early development but shouldn't be used in deployed code.

The MOVD alternative, defining NEW-FOO in terms of OLD-FOO and then (P (MOVD? 'FOO 'OLD-FOO) (MOVD 'NEW-FOO 'FOO)) has drawbacks as well

MASTERSCOPE doesn't know about any of this -- you can move the P into an INIT-NEW-FOO function and change it to (P (INIT-NEW-FOO)) in the fileCOMS and change 'FOO to (FUNCTION FOO).

A different way, with fewer difficulties, if is to use a variable NEW-FOO-ENABLED
and change the original FOO to

(if NEW-FOO-ENABLED then <... new way ... > else < ... old way ...>)
and (INITVARS (NEW-FOO-ENABLED)).

BROWSER and Masterscope had this problem. And I think the MANAGER code uses ADVISE extensively.
I think the manager advice is pretty inocuous (bind a special variable) but the others will take more work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants