I thought this would work:
(defun my-node ()
(interactive)
(pop-to-buffer (make-comint "my-node" "node")))
But when I do M-x my-node and enter 1+1 in the comint buffer, it does not display any output.
This is in Emacs 24.0.50.1 on Windows 7 and NodeJS is installed without any special configuration.
Calling node.js non-interactively as in M-x compile RET node hello-world.js RET works fine. Running node interactively in cmd works fine.
This might be related: when I run M-x shell and enter node in the shell buffer and then enter 1+1, it doesn’t display the result. I must be missing something very basic.
Update:
Probably related: emacs/Python: running python-shell in line buffered vs. block buffered mode – Stack Overflow
I found one solution.
Make a node script which starts a JavaScript REPL interface.
node-in-node.js:
Pass “node path\to\node-in-node.js” to make-comint instead of simply “node”.
Run
M-x my-node-shellto run a JavaScript shell in Windows Emacs. I don’t know why this works. Tab completion, syntax highlight, multiline input via Shift+Enter does not work.