63

What are some REPLs for Emacs Lisp?

Is there only one that is within Emacs?

Are there some that run inside terminal outside Emacs?

Russia Must Remove Putin
  • 374,368
  • 89
  • 403
  • 331
Tim
  • 1
  • 141
  • 372
  • 590

4 Answers4

82

Based on this question: REPL on console emacs, you can use M-x ielm (inferior emacs lisp mode).

Community
  • 1
  • 1
Tikhon Jelvis
  • 67,485
  • 18
  • 177
  • 214
  • 1
    Thanks! Must that run within emacs, or can it run in bash outside emacs? I tried `ieml` or `ielm` in bash, but it doesn't work. – Tim Jul 14 '11 at 02:26
  • 1
    I don't think it can be run outside of Emacs, but I could be wrong. – Tikhon Jelvis Jul 14 '11 at 02:34
  • 'ielm' is a lisp program. It runs only inside emacs. If you want to try things in a terminal, you can use `emacs --batch – Glyph Dec 17 '13 at 04:33
  • 13
    The term "REPL" stands for "read-eval-print-loop" which originally comes from Lisp, which literally has functions named `read`, `eval`, and `print`. Emacs Lisp is no different, so you can do `emacs --batch --eval '(while t (print (eval (read))))'` to get what you want. – Glyph Dec 17 '13 at 04:44
  • 5
    I tend to forget its name, so I made an "alias" for it: `(defun repl() (interactive) (ielm))`. Then you can launch the interpreter with `M-x repl`. – Jabba Oct 19 '14 at 22:50
  • 7
    @Jabba You can also say: `(defalias 'repl 'ielm)` – boskom Feb 18 '16 at 15:41
3

There is a (work in progress) REPL for Emacs for use from the command line. It currently supports basic command line editing and history.

The code is hosted on Github.

Felipe Augusto
  • 7,733
  • 10
  • 39
  • 73
ack
  • 7,356
  • 2
  • 25
  • 20
2

There is this project on Gitlab. The REPL can run on a termninal or on Emacs' minibuffer. Even if you run it in "no-window-system" mode (with -nw).

jcp
  • 71
  • 8
1

One can also just run eshell

M-x eshell

example

~/.emacs.d/org $ (directory-files "." nil ".org") 
("#x1.org#" "#x2.org#" ".#x3.org" ...
Friedrich
  • 5,916
  • 25
  • 45