I recently built a "lower gosu language" for the gosu language. Actually, it turned out to be quite simple: I just expanded comint , which is the mode on which both shell and ielm . Here is an important bit of code:
(require 'comint) (defun inferior-gosu-mode () (interactive) (comint-mode) (setq comint-prompt-regex inferior-gosu-prompt) (setq major-mode 'inferior-gosu-mode) (setq mode-name "Inferior Gosu") (setq mode-line-process '(":%s")) (use-local-map 'inferior-gosu-mode-map))
The use-local-map bit is where you define special key bindings; I have it as a copy of the comm bindings:
(defvar inferior-gosu-mode-map nil) (unless inferior-gosu-mode-map (setq inferior-gosu-mode-map (copy-keymap comint-mode-map)))
After that I had a simple code that defined a command to start a process that would pop up in the *inferior-gosu* buffer if it existed. I also added some code to gosu normal mode to open the lower-gos shell.
In short: use comint .
Here is a link to the whole code, but not so much: https://github.com/TikhonJelvis/Gosu-Mode/blob/master/inferior-gosu-mode.el
Naturally, feel free to use this code as you wish; You can also look at the normal gosu mode to find out how you could integrate you erlang and prologue into the corresponding language editing modes.
Tikhon jelvis
source share