Make rackedit tolerant when there's no GUI available

This commit is contained in:
2026-08-22 14:05:07 +02:00
parent 0d3b55f252
commit b41e312a80
5 changed files with 212 additions and 155 deletions
+11
View File
@@ -49,5 +49,16 @@ For example, the window title can be changed before the frame becomes visible:
The standard File menu does not contain the Exit/Quit command, so closing one
editor window does not imply exiting the application that opened it.
## Headless environments
Requiring `rackedit` does not initialize Racket's GUI subsystem. This means that
`(require rackedit)` is safe in a headless Racket process, for example a server
process without access to an X11 or Wayland display.
The GUI implementation is loaded only when `rkdt` is actually called. Calling
`rkdt` still requires a usable graphical environment. Programs that also support
a terminal editor can therefore choose that editor before calling `rkdt`, without
merely requiring `rackedit` causing GTK initialization.
Full API documentation is included as Scribble documentation in
`scrbl/rkdt.scrbl`.