lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, 28 May 2006 19:16:06 -0500 Javier Guerra wrote:

> On Sunday 28 May 2006 4:53 pm, Jürgen Hötzel wrote:
>> My point was about you have to restart a new Lua process each time you use
>> 'compile and can't interact with the Lua environment of a running process.
>
> would you please elaborate on how does that work? i'm curious if that workflow 
> could be adapted to other editors

Emacs has a `comint-mode' ("command interpreter in a
buffer") that let's you run simple REPL programs within
emacs (e.g. a shell, lisp interpreter or an interactive lua
process).

As it's a normal emacs buffer you can move around the cursor
and c&p text around arbitrary buffers (you don't need a
rodent to mark the text in a xterm, all the familiar key
bindings are working).  The other direction works too: mark
some text in an emacs buffer (e.g. some lua code), press
escape-meta-alt-control-shift and the text is send to the
process.

The nice thing with it is that you can extend it with your
own emacs lisp code:  define your own completion functions,
highlight specific patterns and so on.

You can also hook into special events like output from the
process and eval arbitrary lisp code.  In this case: parse
the output for error messages, get the line number and move
the cursor in the buffer with the lua code to that line.

It's a very convenient way to write code: write a function,
eval the definition, test it, fix the bug, eval again...
Everything w/o leaving the "editor".  But not a that new
invention, emacs has it since the 80s.

David