[code][textadept] "resettable" module (collection)

From: Peter Rolf <indiego.att.gmx.net>
Date: Tue, 20 Jun 2017 15:22:18 +0200


I have just finished my first small module (collection), which adds a
simple reset() persistent data storage, a viewer mode and a timer module
(autosaving implemented).

Download at


Two versions available. The "et" version uses "elastic tabstop".
You will need 7zip to unpack the archive.

It follows a short description, more detailed information in the files.


    Persistent data storage for reset();
    Saves data to a file just before the reset() call, so that it can be
    manually restored after the reset. arg[] is saved by default.
    The storage file is automatically deleted when you quit textadept.

    This module is a pre-requirement for "rtimer" and
    (just to be safe) for "viewer_mode".


    "viewer_mode" opens a single file in read only mode and uses it's
    own instance and session file. More files can be opened (read only)
    any time via file menu or recent file list in every "viewer_mode"
    The only (optional) argument defines the maximal number of recent
    files to store. A value of zero gives a history free viewer mode

    I personally use it in combination with an opened textadept "main"
    instance and TotalCommander (a file manager). It helps, if you have
    the room for an extra window.


    "rtimer" provides the usage of reset() resistant timers, which
    can be
      * added,
      * paused,
      * continued and
      * removed.

    Currently the only implemented timer is "autosave". It saves
    modified buffers after the given interval (in seconds) and also
    saves the current session in an extra session file as backup.

From my "init.lua":

-- resettable
resettable = require("resettable")
viewer_mode = require("resettable.viewer_mode").register(15)
if not ( CURSES or viewer_mode and viewer_mode.active() ) then
  rtimer = require("resettable.rtimer")

I also added "rtimer_test.lua" in case you want to test/play around with
the rtimer module.
Let me know if you find any errors or have ideas for improvements.

Cheers, Peter

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 20 Jun 2017 - 09:22:18 EDT

This archive was generated by hypermail 2.2.0 : Wed 21 Jun 2017 - 06:52:27 EDT