Re: [code] Re: [textadept] experimental spawn

From: Ryan Pusztai <rpusztai.att.gmail.com>
Date: Thu, 21 Mar 2013 16:15:04 -0400

Hi Mitchell,

On Tue, Mar 19, 2013 at 7:03 PM, Mitchell <m.att.foicica.com> wrote:

> Hi Ryan,

lspawn is still supported, but the binaries are compiled for Lua 5.2. Since
> you are on Linux, it should not be hard to compile for LuaJIT. Looking at
> the code, the changes you'd have to make include:
>
> lspawn.c:
> * Add "#define lua_rawlen lua_objlen" in the #includes area.
>
> Makefile:
> * Line 3: change ta_src to your ta source directory.
> * Line 60: change lua/src to luajit/src.

This worked great. It now loads.

I am now trying to launch make and have it's output shown in a [Message
Buffer]. I am launching it from a context menu and a keyboard shortcut. I
have added the code that I am using, but the issue is that it seems like
the spawn is stopping right away and not continuing after a single file is
told to build by make. Do you have any ideas how to add Make support to TA?

Code From post_init.lua:

-- _M.common.project.root() <-- This just returns my projects root
directory if the file that is open is not in the root of the project file

local function RunMake()
gui.statusbar_text = ("Building %s..."):format(
_M.common.project.root():match("[^/]+$") )
 --local h = io.popen( ("cd %s && make"):format( _M.common.project.root() )
)
--gui.print( h:read( "*a" ) )

os.spawn( _M.common.project.root(), { "make" }, nil, nil, gui.print,
gui.print )

gui.statusbar_text = ("Done Building %s..."):format(
_M.common.project.root():match("[^/]+$") )
end
keys.cpp.f7 = RunMake

_M.cpp.context_menu =
{
{ '' },
{ _L['_Undo'], buffer.undo },
 { _L['_Redo'], buffer.redo },
{ '' },
{ _L['Cu_t'], buffer.cut },
 { _L['_Copy'], buffer.copy },
{ _L['_Paste'], buffer.paste },
{ _L['_Delete'], buffer.clear },
 { '' },
{ _L['Select _All'], buffer.select_all },
{ '' },
 { "Make", RunMake }
}

Thanks

--
Regards,
Ryan
-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Thu 21 Mar 2013 - 16:15:04 EDT

This archive was generated by hypermail 2.2.0 : Fri 22 Mar 2013 - 06:32:27 EDT