Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ceving/e024a98c8cc8d94dc8f7fbcc0946fc33 to your computer and use it in GitHub Desktop.
Save ceving/e024a98c8cc8d94dc8f7fbcc0946fc33 to your computer and use it in GitHub Desktop.
Send 'End of Transmussion' to the Scheme process in Emacs

In case of an error Gambit and Guile automatically enter a debugger. In order to leave the debugger it is necessary to press Ctrl-d, which sends the Unicode character 'End of Transmission' (ASCII 0x04 EOT) to the Scheme process. It is necessary to switch buffers for this, becuse "C-d" has a different meaning in the scheme-mode. The following definition extends the scheme-mode by adding the key binding "C-c C-d", which sends EOT to Scheme process.

(defun scheme-send-end-of-transmission ()
  "Send Unicode 'End of Transmussion' to the Scheme process."
  (interactive)
  (comint-send-string (scheme-proc) "\N{End of Transmission}"))

(add-hook 'scheme-mode-hook
          (lambda ()
            (local-set-key (kbd "C-c C-d")
                           #'scheme-send-end-of-transmission)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment