https://github.com/hung-phan/babel-repl.git
git clone 'git://github.com/hung-phan/babel-repl.git'
Thanks tmtxt for his plugin n4js.el
babel
: npm install -g babel
.emacs.d
and add it into load path(add-to-list 'load-path "~/.emacs.d/babel-repl/")
require
(require 'babel-repl)
If you get weird characters in your REPL. Add this code snippet to your configuaration file.
(require 'comint)
(add-to-list 'comint-preoutput-filter-functions
(lambda (output)
(replace-regexp-in-string "\033\\[[0-9]+[A-Z]" "" output)))
Change these variables based on your demand
babel-repl-cli-program
: the name of babel node cli program, default to
babel-node
. Change it to absolute path if it's not in your load path.(setq babel-repl-cli-program "/path/to/babel-node")
babel-repl-cli-arguments
: the list of arguments to pass to babel-node
.
babel-repl-pop-to-buffer
: whether to pop up the babel shell buffer after sending
command to execute.
babel-repl-pop-to-buffer-function
: the function used for pop up the babel node
buffer if the above variable is set to t. Default is pop-to-buffer
. An example
is pop-to-buffer
to pop up the babel buffer to current window
instead of other window.
babel-repl
: start a babel node processbabel-repl-send-current-region
: send the active region to babel node processbabel-repl-send-buffer
: send the whole buffer to babel node processbabel-repl-send-paragraph
: send the paragraph at point to babel node processbabel-repl-send-region-or-buffer
: send the current region if active, otherwise send
the whole buffer to babel node processbabel-repl-send-dwim
: send the current region if active, otherwise send the
paragraph at point to babel node processbabel-repl-switch-to-buffer
: switch to babel node buffer if exist, otherwise,
start a new one(setq babel-repl-cli-arguments '("--trace-sync-io"))