[code] [textadept] Proposed API Changes

From: Mitchell <m.att.foicica.com>
Date: Tue, 19 Mar 2013 11:52:24 -0400 (Eastern Daylight Time)


I've been contemplating changes to the API:

   + Add lfs.dir_foreach(utf8_dir, f, filter, exclude_FILTER)
     Iterates over all files and sub-directories in the directory
     *utf8_dir*, calling function *f* on each file found.
     *filter* and *exclude_FILTER* are identical to
     _M.textadept.snapopen.open()'s respective parameters.
     If *f* returns `false` explicitly, iteration ceases.
   + Add io.MAX or io.SNAPOPEN_MAX
     Same documentation as _M.textadept.snapopen.MAX
   + Add io.snapopen(utf8_paths, filter, exclude_FILTER)
     Same documentation as _M.textadept.snapopen.open.
   - Remove _M.textadept.snapopen.DEFAULT_DEPTH
     It was 99 anyway and MAX is probably more useful.
   - Remove _M.textadept.snapopen
     Moved functionality into core `io`.
   ? io.snapopen's *utf8_paths* should be a '\n' separated string of
     paths and no longer accepts a table (pass result of table.concat()
     instead). This is consistent with io.open_file() which also accepts
     '\n' separated files and not a table.

Would these changes negatively impact anyone's modules? (e.g. textredux)
Obviously it would impact key bindings, but that is relatively minor.

The motivation behind these changes is primarily to allow filtering with
"Find in Files" via a new lfs.dir_foreach() to make it faster and less
limited. Snapopen would also be smaller and seems useful enough to move
into core.

Feedback is encouraged and greatly appreciated.


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 19 Mar 2013 - 11:52:24 EDT

This archive was generated by hypermail 2.2.0 : Wed 20 Mar 2013 - 06:39:52 EDT