Skip to content
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

TAB-WINDOWS: A lispusers package that lets you step through open windows #1789

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
72 changes: 72 additions & 0 deletions lispusers/TAB-WINDOWS
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)

(FILECREATED "24-Jun-2024 16:07:07" {DSK}<Users>hjellinek>Projects>IL>TAB-WINDOWS.;12 2984

:CHANGES-TO (FNS TAB-WINDOWS IS-KEY-DOWN? START-TAB-WINDOWS KEY-WINDOW SHOW-KEYS)
(VARS TAB-WINDOWSCOMS)
(PROPS (TAB-WINDOWS :COMPILE-FILE))

:PREVIOUS-DATE " 4-Jun-2024 09:48:34" {DSK}<Users>hjellinek>Projects>IL>TAB-WINDOWS.;1)


(PRETTYCOMPRINT TAB-WINDOWSCOMS)

(RPAQQ TAB-WINDOWSCOMS ((FNS IS-KEY-DOWN? START-TAB-WINDOWS TAB-WINDOWS SHOW-KEYS KEY-WINDOW)
(PROP :COMPILE-FILE TAB-WINDOWS)))
(DEFINEQ

(IS-KEY-DOWN?
[LAMBDA (KEY-NAME KEYS-DOWN)
(for KEY-NAME-LIST in KEYS-DOWN thereis (FMEMB KEY-NAME KEY-NAME-LIST])

(START-TAB-WINDOWS
[LAMBDA NIL
(ADD.PROCESS '(TAB-WINDOWS)
'NAME "Window Tabber" 'RESTARTABLE T])

(TAB-WINDOWS
[LAMBDA NIL

(* ;; "When the meta and tab keys go down, TOTOPW the next window in OPENWINDOWS")

(DECLARE (CL:SPECIAL \KEYNAMES))
(LET ((CURRENT-WINDOW NIL)
(OPEN-WINDOWS (OPENWINDOWS)))
(CL:UNWIND-PROTECT
[PROGN (while T
do ([LET ((KEYS-DOWN (for K in \KEYNAMES when (KEYDOWNP K) collect K)))
[if (AND (IS-KEY-DOWN? 'TAB KEYS-DOWN)
(IS-KEY-DOWN? 'EXPAND KEYS-DOWN))
then (if CURRENT-WINDOW
then (TOTOPW CURRENT-WINDOW)
(SETQ CURRENT-WINDOW (CADR (FMEMB CURRENT-WINDOW
OPEN-WINDOWS)))
else (SETQ CURRENT-WINDOW (CAR OPEN-WINDOWS]
(if (NOT KEYS-DOWN)
then (SETQ CURRENT-WINDOW NIL)
(SETQ OPEN-WINDOWS (OPENWINDOWS]
(BLOCK 20])])

(SHOW-KEYS
[LAMBDA NIL
(LET ((WINDOW (CREATEW NIL "Keys down")))
(WINDOWPROP WINDOW 'PROCESS (THIS.PROCESS))
[WINDOWPROP WINDOW 'CLOSEFN (FUNCTION (LAMBDA (W)
(DEL.PROCESS (WINDOWPROP W 'PROCESS]
(CL:UNWIND-PROTECT
[PROGN (while T do (LET ((DOWN-KEYS (for K in \KEYNAMES when (KEYDOWNP K) collect K)))
(BLOCK 100)
(CLEARW WINDOW)
(COND
(DOWN-KEYS (PRIN1 DOWN-KEYS WINDOW]
(CLOSEW WINDOW))])

(KEY-WINDOW
[LAMBDA NIL
(ADD.PROCESS '(SHOW-KEYS)
'NAME "Showing Keys" 'RESTARTABLE T])
)
(DECLARE%: DONTCOPY
(FILEMAP (NIL (645 2961 (IS-KEY-DOWN? 655 . 791) (START-TAB-WINDOWS 793 . 915) (TAB-WINDOWS 917 . 2166
) (SHOW-KEYS 2168 . 2845) (KEY-WINDOW 2847 . 2959)))))
STOP
Binary file added lispusers/TAB-WINDOWS.DFASL
Binary file not shown.
Binary file added lispusers/TAB-WINDOWS.TEdit
Binary file not shown.