emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scheme Interpreter in Emacs and Readline


From: Jakub Jankiewicz
Subject: Scheme Interpreter in Emacs and Readline
Date: Sat, 18 Apr 2020 12:51:13 +0200

I have problem in creating Scheme Interpreter in Node.js that can be run
using Emacs run-scheme command. I use Readline library in Node.js and when I
resize the window or frame it keep adding prompt to the prompt line. I've
asked on StackOverflow and also on emacs mailing list but no one answered.

[How to write Node.js REPL that works with GNU Emacs?][1]

Is there special thing the interpreter need to be doing, so it work with
Comint mode? I have the same if I run with emacs -q. Does Emacs run-scheme
work with Readline? Does anyone have issues with this? Is this a bug? I would
like to know if there is workaround. Kawa and Guile works fine in GNU Emacs,
I was checking Kawa source code and it don't use Readline it use stdin stream
and println in Java.

I have this code in my .emacs file:


(defun lips ()
  "call run-scheme with guile interpreter."
  (interactive)
  (run-scheme "/home/kuba/projects/jcubic/lips/bin/lips.js"))


and I have also this 

(autoload 'scheme-mode "cmuscheme" "Major mode for Scheme." t)
(autoload 'run-scheme "cmuscheme" "Switch to interactive Scheme buffer." t)
;; this shouldn't change anything since I'm running the function with argument
(setq scheme-program-name "/home/kuba/projects/jcubic/lips/bin/lips.js")
(add-hook 'scheme-mode-hook 'turn-on-font-lock)

;; there was issue with double echo
;; see my Question on Emacs StackExachange
;; [How to run custom scheme written in node.js using readline in
;; emacs?][2]
(setq comint-process-echoes t)
(setq comint-input-ignoredups t)
(setq comint-prompt-read-only t)

(add-hook 'comint-mode-hook
          (lambda()
            (setq truncate-lines 1)))

[1]: https://stackoverflow.com/q/60987722/387194
[2]: https://emacs.stackexchange.com/q/57521/10438

--
Jakub Jankiewicz, Web Developer
https://jcubic.pl/me



reply via email to

[Prev in Thread] Current Thread [Next in Thread]