Skip to content

Rmk87 minor updates EXAMINEDEFS, REGIONMANAGER, and TEDIT-PF-SEE #2113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions lispusers/EXAMINEDEFS
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)

(FILECREATED "31-Mar-2025 13:53:38" {WMEDLEY}<lispusers>EXAMINEDEFS.;56 16674
(FILECREATED " 6-Apr-2025 23:54:50" {WMEDLEY}<lispusers>EXAMINEDEFS.;57 16827

:EDIT-BY rmk

:CHANGES-TO (FNS EXAMINEDEFS)
:CHANGES-TO (FNS TEDITDEF)

:PREVIOUS-DATE "18-Feb-2025 23:01:57" {WMEDLEY}<lispusers>EXAMINEDEFS.;55)
:PREVIOUS-DATE "31-Mar-2025 13:53:38" {WMEDLEY}<lispusers>EXAMINEDEFS.;56)


(PRETTYCOMPRINT EXAMINEDEFSCOMS)
Expand Down Expand Up @@ -198,11 +198,12 @@
NIL TITLE2])

(TEDITDEF
[LAMBDA (NAME DEF TYPE READERENVIRONMENT WIDTH) (* ; "Edited 13-Oct-2023 00:23 by rmk")
[LAMBDA (NAME DEF TYPE READERENVIRONMENT WIDTH) (* ; "Edited 6-Apr-2025 23:53 by rmk")
(* ; "Edited 13-Oct-2023 00:23 by rmk")
(* ; "Edited 23-Jun-2022 17:27 by rmk")
(* ; "Edited 28-Jan-2022 23:36 by rmk")
(* ; "Edited 12-Jan-2022 17:27 by rmk")
(LET ((TSTREAM (OPENTEXTSTREAM)))
(LET [(TSTREAM (OPENTEXTSTREAM NIL NIL `(BOUNDTABLE ,(TEDIT.ATOMBOUND.READTABLE]
(DSPFONT DEFAULTFONT TSTREAM)
(CL:WHEN WIDTH
(LINELENGTH (IQUOTIENT WIDTH (CHARWIDTH (CHARCODE SPACE)
Expand Down Expand Up @@ -280,6 +281,6 @@
(FILESLOAD (SYSLOAD)
COMPARETEXT VERSIONDEFS)
(DECLARE%: DONTCOPY
(FILEMAP (NIL (665 16443 (EXAMINEDEFS 675 . 10997) (EXAMINEFILES 10999 . 12481) (TEDITDEF 12483 .
14649) (EXVV 14651 . 16441)))))
(FILEMAP (NIL (662 16596 (EXAMINEDEFS 672 . 10994) (EXAMINEFILES 10996 . 12478) (TEDITDEF 12480 .
14802) (EXVV 14804 . 16594)))))
STOP
Binary file modified lispusers/EXAMINEDEFS.LCOM
Binary file not shown.
Binary file modified lispusers/GITFNS.TEDIT
Binary file not shown.
36 changes: 21 additions & 15 deletions lispusers/REGIONMANAGER
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)

(FILECREATED "25-Nov-2024 17:59:00" {WMEDLEY}<lispusers>REGIONMANAGER.;135 42008
(FILECREATED "20-Apr-2025 12:57:07" {WMEDLEY}<lispusers>REGIONMANAGER.;137 42626

:EDIT-BY rmk

:CHANGES-TO (FNS \RELCREATEREGION.REF)
:CHANGES-TO (FNS RM-CLOSEW)

:PREVIOUS-DATE "27-Oct-2024 21:59:33" {WMEDLEY}<lispusers>REGIONMANAGER.;134)
:PREVIOUS-DATE "25-Nov-2024 17:59:00" {WMEDLEY}<lispusers>REGIONMANAGER.;135)


(PRETTYCOMPRINT REGIONMANAGERCOMS)
Expand Down Expand Up @@ -172,7 +172,8 @@
WINDOW])

(RM-CLOSEW
[LAMBDA (WINDOW) (* ; "Edited 10-Oct-2023 22:11 by rmk")
[LAMBDA (WINDOW) (* ; "Edited 20-Apr-2025 12:40 by rmk")
(* ; "Edited 10-Oct-2023 22:11 by rmk")

(* ;;
 "Makes the window's typed region available for reuse, if the window is marked with a TYPEDREGION.")
Expand All @@ -181,14 +182,19 @@

(* ;; "This replaces the particular typed-region in TYPED-REGIONS with the region that the window ended up with, perhaps after the user reshaped it. But (WINDOWPROP WINDOW 'REGION) doesn't include the prompt window, if it's there, and (WINDOWREGION WINDOW) would union in all of the attached windows (menus etc.) This code assumes that the promptwindow was taken out of the original region (lots of funky code does that), so it unions it back in to the REGION property to reconstruct the original typed-region. The alternative would be to have the windows region copy the original grabbed region and restore only that. But then we would be ignoring any reshaping adjustments.")

(* ;; "")

(* ;; "There is another use case (e.g. Tedit window-splitting) where the window is reshaped for temporary purposes, but the new shape is not intended to replace the original typed-region if that region is reused. If the window has the property SAVED-TYPED-REGION (presumably a copy of the original one), then that region is installed in the TYPED-REGION before it is saved back on the TYPED-REGION-LIST")

(LET* [CLOSEVAL (TYPEDREGION (WINDOWPROP WINDOW 'TYPED-REGION))
(REGIONTYPE (CAR TYPEDREGION))
(TREGION (CDR TYPEDREGION))
[PWINDOW (WINDOWP (CAR (MKLIST (WINDOWPROP WINDOW 'PROMPTWINDOW]
[WREGION (CL:IF PWINDOW
(UNIONREGIONS (WINDOWPROP WINDOW 'REGION)
(WINDOWPROP PWINDOW 'REGION))
(WINDOWPROP WINDOW 'REGION))]
[WREGION (OR (WINDOWPROP WINDOW 'SAVED-TYPED-REGION)
(CL:IF PWINDOW
(UNIONREGIONS (WINDOWPROP WINDOW 'REGION)
(WINDOWPROP PWINDOW 'REGION))
(WINDOWPROP WINDOW 'REGION))]
(TREGIONLIST (AND REGIONTYPE (OR (ASSOC REGIONTYPE TYPED-REGIONS)
(CAR (PUSH TYPED-REGIONS (CONS REGIONTYPE]
(CL:WHEN (AND (SETQ CLOSEVAL (CLOSEW.ORIG WINDOW))
Expand Down Expand Up @@ -746,11 +752,11 @@
)
)
(DECLARE%: DONTCOPY
(FILEMAP (NIL (1622 6740 (SET-TYPED-REGIONS 1632 . 3807) (GRAB-TYPED-REGION 3809 . 4835) (
REGISTER-TYPED-REGION 4837 . 6134) (REGION-TYPE 6136 . 6738)) (6741 14810 (RM-CREATEW 6751 . 8874) (
RM-CLOSEW 8876 . 11894) (RM-GETREGION 11896 . 14045) (CLOSE-TYPED-W 14047 . 14808)) (15453 22932 (
RELCREATEREGION 15463 . 20086) (RELGETREGION 20088 . 22695) (RELCREATEPOSITION 22697 . 22930)) (22933
30508 (\RELCREATEREGION.REF 22943 . 27465) (\RELCREATEREGION.SIZE 27467 . 30506)) (30561 39903 (
RM-ATTACHWINDOW 30571 . 39901)) (39904 41638 (CLOSEWITH 39914 . 40441) (CLOSEWITH.DOIT 40443 . 40723)
(MOVEWITH 40725 . 41248) (MOVEWITH.DOIT 41250 . 41636)))))
(FILEMAP (NIL (1611 6729 (SET-TYPED-REGIONS 1621 . 3796) (GRAB-TYPED-REGION 3798 . 4824) (
REGISTER-TYPED-REGION 4826 . 6123) (REGION-TYPE 6125 . 6727)) (6730 15428 (RM-CREATEW 6740 . 8863) (
RM-CLOSEW 8865 . 12512) (RM-GETREGION 12514 . 14663) (CLOSE-TYPED-W 14665 . 15426)) (16071 23550 (
RELCREATEREGION 16081 . 20704) (RELGETREGION 20706 . 23313) (RELCREATEPOSITION 23315 . 23548)) (23551
31126 (\RELCREATEREGION.REF 23561 . 28083) (\RELCREATEREGION.SIZE 28085 . 31124)) (31179 40521 (
RM-ATTACHWINDOW 31189 . 40519)) (40522 42256 (CLOSEWITH 40532 . 41059) (CLOSEWITH.DOIT 41061 . 41341)
(MOVEWITH 41343 . 41866) (MOVEWITH.DOIT 41868 . 42254)))))
STOP
Binary file modified lispusers/REGIONMANAGER.LCOM
Binary file not shown.
7 changes: 4 additions & 3 deletions lispusers/REGIONMANAGER.TEDIT
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ REGIONMANAGER
4

By Ron Kaplan
This document created in December 2021, last edited September 2023.
This document created in December 2021, last edited April 2025.

Medley comes equipped with a core set of functions for specifying regions and creating the windows that occupy those regions on the screen. But it can be disruptive if not irritating to have to draw out a new ghost region for every invocation of a particular application. Thus the common applications (e.g. TEDIT, SEDIT, DINFO...) implement particular strategies to reduce the number of times that a user has to sweep out a new region. They instead default to regions that were allocated for earlier invocations that are no longer active. TEDIT for example recycles the region of a session that was recently shut down, SEDIT allocates from a list of previous regions, DINFO always uses the same region, but FILEBROWSER always prompts for a new one. Applications that do recycle their regions tend to do so indiscrimately, without regard to the current arrangement of other windows on the screen or the role that those windows may play in higher-level applications.
The REGIONMANAGER package provides simple extensions to the core region and window functions. These are aimed at giving users and application implementors more flexible and systematic control over the specification and reuse of screen regions. It introduces three new notions:
Expand All @@ -25,6 +25,7 @@ REGIONMANAGER adds overlay veneers to the core CREATEW, CLOSEW, and GETREGION fu
The REGION/INITREGION arguments may now be region-type atoms in addition to either NIL or particular regions as CREATEW and GETREGION otherwise allow. The type-atom will resolve to a region drawn from a predefined pool of regions associated with that type, if the pool has at least one that is not currently allocated to another window. If the pool has no available regions, then the pool will be enlarged with a region that the user produces from a normal ghost-region prompt, and the type-atom will then resolve to the newly installed region.
A typed-region is marked as "inuse" and therefore unavailable when CREATEW assigns it to a window, and the extended CLOSEW marks it as again available when the window is closed. The region of the most recently closed window will be offered the next time a region of its type is requested.
An example of how an application can take advantage of this facility is the TEDIT-PF-SEE package. This provides lightweight alternatives to the PF and SEE commands that print their output to scrollable read-only Tedit windows, specifying PF-TEDIT and SEE-TEDIT as their region types. The user can predefine a preference-ordered sequence of recyclable regions that bring up multiple output windows in a predictable tiled arrangement, without region-prompting for each invocation.
If a window opened with a typed region is reshaped, usually the new shape of that window is made available after closing for another window of the same type. But sometimes the reshaping is for transitory purposes, for example , the reshaping that Tedit uses to split windows, and the client wants more control over the region that will be recycled. The client can store the intended region as the value of the window property SAVED-TYPED-REGION before closing, and that is the region that will be recycled.
The global variable TYPED-REGIONS is an alist that maintains the relationship between atomic type-names and the list of regions that belong to each type. The list is ordered according to preferences set by the user, and a type-atom is always resolved to the first unused region in its list. If the user is asked to sweep out a new region, that region is added at the end, as the least preferable. The function SET-TYPED-REGIONS is provided to add or replace TYPED-REGION entries.
(SET-TYPED-REGIONS TYPELISTS REPLACE) [Function]
TYPELISTS is an alist of the form
Expand Down Expand Up @@ -82,10 +83,10 @@ If NEWPOS is the new position of PARENT, moves each of the move-children so that
CLASSIC
TERMINALMODERN TERMINAL��TERMINAL��
TIMESROMAN$ HRULE.GETFN  HRULE.GETFN  HRULE.GETFN   HRULE.GETFN  HRULE.GETFN
D� � � �}/ �[ �C��T ��1 
@� � � �}/ �[ �C*��T ��@�1 

; 3o)�� �  4 n � o2 V@1 %! A  &MmIS-g<
3E
"

l /4 v2C � &% "O=  , l�)9���W~ �& 4!Uh'�2&�$"&()MDATE:ie�m3\�z�
l /4 v2C � &% "O=  , l�)9���W~ �& 4!Uh'�2&�$"&()MDATE:i�*�5V�z�
Expand Down
Loading