Re: [code] [textadept] Checking for changed files on disk

From: Mitchell <m.att.foicica.com>
Date: Tue, 5 Nov 2013 23:07:52 -0500 (EST)

Hi Chris,

On Tue, 5 Nov 2013, Chris Emerson wrote:

> Hi,
>
> When changing views/buffers, textadept will check if the file on disk is
> newer, and prompt to reload it.
>
> What would be the recommended way of triggering that check on other events?
> I've mapped C-z to suspend textadept-curses (by sending it a SIGTSTP via a C
> module), and it'd be nice to have it do the check when it's resumed. I might
> want to do it on all currently-open views. Or I might kick off a program
> which is expected to modify the current file.
>
> I could duplicate core/file_io.lua:update_modified_file(), or do some
> combination of switching buffers/views and manually emiting
> BUFFER/VIEW_AFTER_SWITCH events, but it would be nice to have a standard API
> for it.

Since this is a pretty special case (I cannot think of anything similar on
other platforms), I don't feel like exposing a low-level `io` function is
justified; I would copy the functionality for your own use. Jumping
through hoops to manually emit the proper events seems too hackish.

Cheers,
Mitchell

-- 
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 Tue 05 Nov 2013 - 23:07:52 EST

This archive was generated by hypermail 2.2.0 : Wed 06 Nov 2013 - 06:32:18 EST