REPL for Emacs Lisp
Asked Answered
W

4

64

What are some REPLs for Emacs Lisp?

Is there only one that is within Emacs?

Are there some that run inside terminal outside Emacs?

Winebaum answered 14/7, 2011 at 2:7 Comment(0)
W
83

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

Waldheim answered 14/7, 2011 at 2:23 Comment(6)
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.Winebaum
I don't think it can be run outside of Emacs, but I could be wrong.Waldheim
'ielm' is a lisp program. It runs only inside emacs. If you want to try things in a terminal, you can use `emacs --batchAlbacore
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.Albacore
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.Smalltime
@Smalltime You can also say: (defalias 'repl 'ielm)Littlest
B
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.

Becky answered 17/4, 2016 at 19:42 Comment(0)
F
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).

Fulton answered 12/5, 2020 at 23:38 Comment(0)
W
1

One can also just run eshell

M-x eshell

example

~/.emacs.d/org $ (directory-files "." nil ".org") 
("#x1.org#" "#x2.org#" ".#x3.org" ...
Weeper answered 31/3, 2023 at 15:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.