A Sample Edwin Configuration File

It can be quite a challenge to find online documentation on customizing Edwin, the text editor bundled with MIT Scheme. It is also equally difficult to get your hands on example .edwin configuration files from which to make your own custom configuration. That is most likely because of the very small community of people who use MIT Scheme, let alone the Edwin text editor. So here is my custom .edwin file. If you are using MIT Scheme on a UNIX-like system (e.g. Debian, Ubuntu, Red Hat, etc.), the path to the file should be ~/.edwin.

;; Configuration file for the Edwin text editor. Goes in ~/.edwin.

;; Whether or not Edwin is in a graphical window (as opposed to being in a terminal).
(define EDWIN-IS-IN-WINDOW (not (member 'console create-editor-args)))

;; Settings to use only when Edwin is in a graphical window.
        ((ref-command set-foreground-color) "black")
        ((ref-command set-background-color) "white")
        ((ref-command set-mouse-color) "black")
        ((ref-command set-cursor-color) "black")
        ((ref-command set-font) "10x20")
        ((ref-command set-frame-size) 85 40)
        ((ref-command set-frame-position) 0 0))
      (else '()))

;; Auto-saves.
(set-variable! auto-save-interval 100)  ; Number of keyboard input characters between auto-saves.

;; Backups.
(set-variable! backup-by-copying #t)
(set-variable! kept-new-versions 5)
(set-variable! kept-old-versions 0)
(set-variable! trim-versions-without-asking #t)  ; Delete excess backup versions silently.
(set-variable! version-control #t)  ; Always use version numbers for backup files.
(set-variable! vc-make-backup-files #t)  ; Create backup files even for files covered by version control.

;; Other.
(set-variable! require-final-newline #t)
(set-variable! file-precious-flag #t)  ; Protect against I/O errors while saving files.

I hope I have adequately commented the code. The configuration file works for both using Edwin in a window and using Edwin in a terminal. For Edwin in a window, the default font size is too small, so the configuration file above makes the font size larger.

A good way to determine whether or not the configuration file is loaded is to add (message ".edwin is loaded!") to the end of the configuration file. If the configuration file is loaded, the message should appear at the bottom of Edwin.

If you are unsure what each of the variables do, you can access the help system in Edwin by typing C-h v, and after that, enter the name of the variable you would like to know more about (e.g. require-final-newline). If that search method does not work for you, try using C-h a, and then enter the search term (e.g. set-mouse-color). I hope this article is of help.

Oh, and I license the above configuration file under CC0 1.0 Universal, so feel free to use it as you see fit.