Re: [code] Hook to the save event

From: Robert <>
Date: Sun, 18 Nov 2012 17:31:43 +0100


the official Ruby[1] and Python [2] have after save events that you
could use as a starting point.
Something like this could work for you:

events.connect(events.FILE_AFTER_SAVE, function()
  if buffer:get_lexer() == 'hypertext' then
    -- set ftp settings according to filename
    -- ...
    local ftp_command = ...
    local p = io.popen(ftp_command .. '2>&1')

Note that this is blocking, so it might be less useful if your ftp
syncing is slow.



On Sun, Nov 18, 2012 at 4:44 PM, fedekun <> wrote:
> Hi! I'm new to TextAdept, it seems like a really nice editor and I'd love to
> use it more on my web development duties, but as it's not as popular as
> Sublime, there are way less plugins, this is cool, but I want to make an FTP
> Sync plugin, I saw the lua api doc, but I coudln't find how to hook on
> certain events, I want to hook on the save event, and upload the file via
> FTP, is this possible?
> Thanks in advance.
> --
> Best Regards.
> fedekun

You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Sun 18 Nov 2012 - 11:31:43 EST

This archive was generated by hypermail 2.2.0 : Mon 19 Nov 2012 - 06:52:43 EST