Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs Lisp: How to, an interactive buffer with REPL?

Imagine the dunnet.el game, the eliza doctor or the IELM mode...; This is, evaluating answers and prompting new questions on the main buffer, then making some actions according to their elisp rules.

I would to create something like an interactive assistant, BUT NOT prompting from minibuffer as (interactive) does (not doing M-x)... I need a kind of REPL loop. So the question i how to get interaction on the working buffer (the main screen), like any text conversational/adventure, but for call my defun'ed functions on this way.

So i need a basic elisp skeleton, to make a custom REPL. The target is to make an assistant with a natural language, then parsing the anwsers, and making some actions according the rules.

Thank you for your time,

Steve,

like image 279
user577475 Avatar asked Jan 16 '11 15:01

user577475


2 Answers

Check out ielm, which is an elisp repl included with emacs.

like image 114
user347585 Avatar answered Sep 23 '22 10:09

user347585


Depending on what can go on in your buffer, can you just give it a major mode with an appropriate re-binding of return? (This answer vaguely inspired by Lisp-Interaction-Mode's C-j)

like image 2
Ulrich Schwarz Avatar answered Sep 23 '22 10:09

Ulrich Schwarz