Skip to content

Commit 6c02508

Browse files
authored
Rmk87 minor updates EXAMINEDEFS, REGIONMANAGER, and TEDIT-PF-SEE (#2113)
* EXAMINEDEFS uses the Tedit atom-bound table for word selection * REGIONMANAGER gives client better control over region recovered * TEDIT-PF-SEE: Meta-T defaults to showing the definition in the curren… * REGIONMANAGER and GITFNS documentation update
2 parents f53da75 + 46fe81b commit 6c02508

File tree

8 files changed

+61
-44
lines changed

8 files changed

+61
-44
lines changed

lispusers/EXAMINEDEFS

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
22

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

55
:EDIT-BY rmk
66

7-
:CHANGES-TO (FNS EXAMINEDEFS)
7+
:CHANGES-TO (FNS TEDITDEF)
88

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

1111

1212
(PRETTYCOMPRINT EXAMINEDEFSCOMS)
@@ -198,11 +198,12 @@
198198
NIL TITLE2])
199199

200200
(TEDITDEF
201-
[LAMBDA (NAME DEF TYPE READERENVIRONMENT WIDTH) (* ; "Edited 13-Oct-2023 00:23 by rmk")
201+
[LAMBDA (NAME DEF TYPE READERENVIRONMENT WIDTH) (* ; "Edited 6-Apr-2025 23:53 by rmk")
202+
(* ; "Edited 13-Oct-2023 00:23 by rmk")
202203
(* ; "Edited 23-Jun-2022 17:27 by rmk")
203204
(* ; "Edited 28-Jan-2022 23:36 by rmk")
204205
(* ; "Edited 12-Jan-2022 17:27 by rmk")
205-
(LET ((TSTREAM (OPENTEXTSTREAM)))
206+
(LET [(TSTREAM (OPENTEXTSTREAM NIL NIL `(BOUNDTABLE ,(TEDIT.ATOMBOUND.READTABLE]
206207
(DSPFONT DEFAULTFONT TSTREAM)
207208
(CL:WHEN WIDTH
208209
(LINELENGTH (IQUOTIENT WIDTH (CHARWIDTH (CHARCODE SPACE)
@@ -280,6 +281,6 @@
280281
(FILESLOAD (SYSLOAD)
281282
COMPARETEXT VERSIONDEFS)
282283
(DECLARE%: DONTCOPY
283-
(FILEMAP (NIL (665 16443 (EXAMINEDEFS 675 . 10997) (EXAMINEFILES 10999 . 12481) (TEDITDEF 12483 .
284-
14649) (EXVV 14651 . 16441)))))
284+
(FILEMAP (NIL (662 16596 (EXAMINEDEFS 672 . 10994) (EXAMINEFILES 10996 . 12478) (TEDITDEF 12480 .
285+
14802) (EXVV 14804 . 16594)))))
285286
STOP

lispusers/EXAMINEDEFS.LCOM

54 Bytes
Binary file not shown.

lispusers/GITFNS.TEDIT

25 Bytes
Binary file not shown.

lispusers/REGIONMANAGER

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
22

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

55
:EDIT-BY rmk
66

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

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

1111

1212
(PRETTYCOMPRINT REGIONMANAGERCOMS)
@@ -172,7 +172,8 @@
172172
WINDOW])
173173

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

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

182183
(* ;; "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.")
183184

185+
(* ;; "")
186+
187+
(* ;; "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")
188+
184189
(LET* [CLOSEVAL (TYPEDREGION (WINDOWPROP WINDOW 'TYPED-REGION))
185190
(REGIONTYPE (CAR TYPEDREGION))
186191
(TREGION (CDR TYPEDREGION))
187192
[PWINDOW (WINDOWP (CAR (MKLIST (WINDOWPROP WINDOW 'PROMPTWINDOW]
188-
[WREGION (CL:IF PWINDOW
189-
(UNIONREGIONS (WINDOWPROP WINDOW 'REGION)
190-
(WINDOWPROP PWINDOW 'REGION))
191-
(WINDOWPROP WINDOW 'REGION))]
193+
[WREGION (OR (WINDOWPROP WINDOW 'SAVED-TYPED-REGION)
194+
(CL:IF PWINDOW
195+
(UNIONREGIONS (WINDOWPROP WINDOW 'REGION)
196+
(WINDOWPROP PWINDOW 'REGION))
197+
(WINDOWPROP WINDOW 'REGION))]
192198
(TREGIONLIST (AND REGIONTYPE (OR (ASSOC REGIONTYPE TYPED-REGIONS)
193199
(CAR (PUSH TYPED-REGIONS (CONS REGIONTYPE]
194200
(CL:WHEN (AND (SETQ CLOSEVAL (CLOSEW.ORIG WINDOW))
@@ -746,11 +752,11 @@
746752
)
747753
)
748754
(DECLARE%: DONTCOPY
749-
(FILEMAP (NIL (1622 6740 (SET-TYPED-REGIONS 1632 . 3807) (GRAB-TYPED-REGION 3809 . 4835) (
750-
REGISTER-TYPED-REGION 4837 . 6134) (REGION-TYPE 6136 . 6738)) (6741 14810 (RM-CREATEW 6751 . 8874) (
751-
RM-CLOSEW 8876 . 11894) (RM-GETREGION 11896 . 14045) (CLOSE-TYPED-W 14047 . 14808)) (15453 22932 (
752-
RELCREATEREGION 15463 . 20086) (RELGETREGION 20088 . 22695) (RELCREATEPOSITION 22697 . 22930)) (22933
753-
30508 (\RELCREATEREGION.REF 22943 . 27465) (\RELCREATEREGION.SIZE 27467 . 30506)) (30561 39903 (
754-
RM-ATTACHWINDOW 30571 . 39901)) (39904 41638 (CLOSEWITH 39914 . 40441) (CLOSEWITH.DOIT 40443 . 40723)
755-
(MOVEWITH 40725 . 41248) (MOVEWITH.DOIT 41250 . 41636)))))
755+
(FILEMAP (NIL (1611 6729 (SET-TYPED-REGIONS 1621 . 3796) (GRAB-TYPED-REGION 3798 . 4824) (
756+
REGISTER-TYPED-REGION 4826 . 6123) (REGION-TYPE 6125 . 6727)) (6730 15428 (RM-CREATEW 6740 . 8863) (
757+
RM-CLOSEW 8865 . 12512) (RM-GETREGION 12514 . 14663) (CLOSE-TYPED-W 14665 . 15426)) (16071 23550 (
758+
RELCREATEREGION 16081 . 20704) (RELGETREGION 20706 . 23313) (RELCREATEPOSITION 23315 . 23548)) (23551
759+
31126 (\RELCREATEREGION.REF 23561 . 28083) (\RELCREATEREGION.SIZE 28085 . 31124)) (31179 40521 (
760+
RM-ATTACHWINDOW 31189 . 40519)) (40522 42256 (CLOSEWITH 40532 . 41059) (CLOSEWITH.DOIT 41061 . 41341)
761+
(MOVEWITH 41343 . 41866) (MOVEWITH.DOIT 41868 . 42254)))))
756762
STOP

lispusers/REGIONMANAGER.LCOM

35 Bytes
Binary file not shown.

lispusers/REGIONMANAGER.TEDIT

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ REGIONMANAGER
1111
4
1212

1313
By Ron Kaplan
14-
This document created in December 2021, last edited September 2023.
14+
This document created in December 2021, last edited April 2025.
1515

1616
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.
1717
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:
@@ -25,6 +25,7 @@ REGIONMANAGER adds overlay veneers to the core CREATEW, CLOSEW, and GETREGION fu
2525
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.
2626
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.
2727
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.
28+
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.
2829
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.
2930
(SET-TYPED-REGIONS TYPELISTS REPLACE) [Function]
3031
TYPELISTS is an alist of the form
@@ -82,10 +83,10 @@ If NEWPOS is the new position of PARENT, moves each of the move-children so that
8283
CLASSIC
8384
TERMINALMODERN TERMINAL��TERMINAL��
8485
TIMESROMAN$ HRULE.GETFN  HRULE.GETFN  HRULE.GETFN   HRULE.GETFN  HRULE.GETFN
85-
D� � � �}/ �[ �C��T ��1 
86+
@� � � �}/ �[ �C*��T ��@�1 
8687

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

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

0 commit comments

Comments
 (0)