ANN: lua-mode for emacs moved to luaforge.net

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

ANN: lua-mode for emacs moved to luaforge.net

Jürgen Hötzel
Hi,

Lua-Mode is an emacs major mode for editing Lua code. I released version 20060528 on luaforge.net:

http://luaforge.net/frs/shownotes.php?release_id=458

Most important change:

* lua-postprocess-output-buffer: jump to lua errors in source files

All contributions are gratefully appreciated.

Jürgen




Reply | Threaded
Open this post in threaded view
|

Re: ANN: lua-mode for emacs moved to luaforge.net

David Hansen-2
On Sun, 28 May 2006 13:21:33 +0200 Jürgen Hötzel wrote:

> * lua-postprocess-output-buffer: jump to lua errors in source files

Emacs compile.el "catch all" regexp works pretty well with
lua error messages (at least with GNU Emacs 22).  Just set
`compile-command' to something useful.

David

Reply | Threaded
Open this post in threaded view
|

Re: ANN: lua-mode for emacs moved to luaforge.net

Jürgen Hötzel
On Sun, May 28, 2006 at 06:58:15PM +0200, David Hansen wrote:
> On Sun, 28 May 2006 13:21:33 +0200 Jürgen Hötzel wrote:
>
> > * lua-postprocess-output-buffer: jump to lua errors in source files
>
> Emacs compile.el "catch all" regexp works pretty well with
> lua error messages (at least with GNU Emacs 22).  Just set
> `compile-command' to something useful.

Yes. But i prefer running Lua as an inferior comint process, so i can
develop code incrementally and interactively and never have to stop for a
"compilation cycle".  This is why i adopted *-postprocess-output-buffer
from python mode.

Jürgen
Reply | Threaded
Open this post in threaded view
|

Re: ANN: lua-mode for emacs moved to luaforge.net

David Hansen-2
On Sun, 28 May 2006 21:13:56 +0200 Jürgen Hötzel wrote:

> On Sun, May 28, 2006 at 06:58:15PM +0200, David Hansen wrote:
>> On Sun, 28 May 2006 13:21:33 +0200 Jürgen Hötzel wrote:
>>
>> > * lua-postprocess-output-buffer: jump to lua errors in source files
>>
>> Emacs compile.el "catch all" regexp works pretty well with
>> lua error messages (at least with GNU Emacs 22).  Just set
>> `compile-command' to something useful.
>
> Yes. But i prefer running Lua as an inferior comint process, so i can
> develop code incrementally and interactively and never have to stop for a
> "compilation cycle".  This is why i adopted *-postprocess-output-buffer
> from python mode.

Oh, you don't have to "compile" a file to use `compile'.
Something like

  (setq compile-command (concat "lua " (buffer-file-name)))

is OK.

Anyway to make this work on regions is a bit more tricky and
i guess you have to use the evil `defadvice'

BTW:

  (lua-start-process lua-default-application lua-default-application)

in line 986 looks like bug.

David

Reply | Threaded
Open this post in threaded view
|

Re: ANN: lua-mode for emacs moved to luaforge.net

Jürgen Hötzel
On Sun, May 28, 2006 at 10:27:32PM +0200, David Hansen wrote:

> On Sun, 28 May 2006 21:13:56 +0200 Jürgen Hötzel wrote:
>
> > On Sun, May 28, 2006 at 06:58:15PM +0200, David Hansen wrote:
> >> On Sun, 28 May 2006 13:21:33 +0200 Jürgen Hötzel wrote:
> >>
> >> > * lua-postprocess-output-buffer: jump to lua errors in source files
> >>
> >> Emacs compile.el "catch all" regexp works pretty well with
> >> lua error messages (at least with GNU Emacs 22).  Just set
> >> `compile-command' to something useful.
> >
> > Yes. But i prefer running Lua as an inferior comint process, so i can
> > develop code incrementally and interactively and never have to stop for a
> > "compilation cycle".  This is why i adopted *-postprocess-output-buffer
> > from python mode.
>
> Oh, you don't have to "compile" a file to use `compile'.
> Something like
>
>   (setq compile-command (concat "lua " (buffer-file-name)))
>
> is OK.

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.
 
> Anyway to make this work on regions is a bit more tricky and
> i guess you have to use the evil `defadvice'
>
> BTW:
>
>   (lua-start-process lua-default-application lua-default-application)

This code is confusing but correct: First parameter is the comint process
name, the second is the program to execute.

I made the second parameter optional in CVS. Thanks for your suggestion.
 
> in line 986 looks like bug.
>
> David

Jürgen
Reply | Threaded
Open this post in threaded view
|

Re: ANN: lua-mode for emacs moved to luaforge.net

Javier Guerra Giraldez
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

--
Javier

attachment0 (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ANN: lua-mode for emacs moved to luaforge.net

David Hansen-2
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