[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Lua debugger under Emacs?
- From: "Rici Lake" <lua@...>
- Date: Tue, 1 May 2007 15:16:36 +0100 (BST)
After some experimentation and a certain amount of help from various people,
I managed to get emacs on windows hooked up to ldb, although I find the
performance sluggish in comparison with vim.
I downloaded emacsclientw (and, indeed, the rest of the emacs install) from
http://ourcomments.org/Emacs/EmacsW32.html and more or less followed
the instructions from http://www.emacswiki.org/cgi-bin/emacs-en/EmacsW32
The rest was just trial and error and asking questions on irc, and I
ended up with the following (you'll have to adjust it for the location
of the emacsclientw executable, of course). The truly bizarre command
line is the only way I could find to get quoting to work with the
Windows shell, but there may well be a better way.
I also had to change the .emacs file installed by emacsw32 to not
maximize the gvim window on startup:
Here's the ldb-config.lua file:
local FNLN = 'cmd /c ""u:\\program
'"(let ((buffer (find-file-noselect %s)) '..
' (pop-up-frames nil) '..
' (display-buffer-reuse-frames t)) '..
' (set-buffer buffer) '..
' (select-window (display-buffer buffer nil 0)) '..
' (goto-line %d))""'
local osexec = os.execute
-- Open an emacs window and allow 1 second for it to open before the first
-- is reached.
--osexec('emacs --funcall=server-start &')
local function quotefn(filename)
filename = ("%q"):format(filename)
PROMPT = "(ldb) ",
PROMPT2 = " >>> ",
input = function(prompt)
io.write(prompt); return io.read"*l"
output = print,
error = print,
edit = function(filename, lineno)
return osexec(FNLN:format(quotefn(filename), lineno))
enterframe = function(state)
local filename = state.here.source:match"^@(.*)"
if filename then
osexec(FNLN:format(quotefn(filename), state.here.currentline or 1))
load_plugins = function()