API Changes

From: mitchell <mforal.n....at.gmail.com>
Date: Sat, 12 Jun 2010 21:10:43 -0700 (PDT)

Hi,

The next release of Textadept will have some major API changes. Jay's
work on shortening command entries[1] has led me to conclude the
current API is very clunky. (Don't worry Jay, you won't have to
rewrite it!)

[1]:
http://groups.google.com/group/textadept/browse_thread/thread/9e0e8d31698bc6a5/e85dab84edabd880?lnk=gst&q=command+entry#e85dab84edabd880

Latest hg has a number of changes:

* Core extension modules (from core/ext) have all been moved to the
textadept module.
* The lsnippets module has been renamed to snippets.
* The keys and key_commands modules have been merged into a keys.lua.
(As a result, ~/.textadept/keys.lua is loaded instead of
key_commands.lua)
* textadept.events has been renamed to _G.events and handle and
add_handler have been renamed to emit and connect, respectively (like
GTK's event API).
* textadept.{constants,buffer_functions,buffer_properties} have been
moved into a new _SCINTILLA module with constants, functions, and
properties tables respectively.
* textadept.{buffers,views} has been renamed to _BUFFERS and _VIEWS
respectively.
* Created a new gui module that has the following changes:
  Renamed textadept._print() to gui._print().
  Renamed textadept.check_focused_buffer() to
gui.check_focused_buffer().
  Renamed textadept.clipboard_text to gui.clipboard_text.
  Renamed textadept.context_menu to gui.context_menu
  Renamed textadept.command_entry to gui.command_entry.
  Renamed textadept.dialog to gui.dialog.
  Renamed textadept.docstatusbar_text to gui.docstatusbar_text.
  Renamed textadept.find to gui.find.
  Renamed textadept.focused_doc_pointer to gui.focused_doc_pointer.
  Renamed textadept.get_split_table() to gui.get_split_table().
  Renamed textadept.gtkmenu() to gui.gtkmenu().
  Renamed textadept.goto_view() to gui.goto_view().
  Renamed textadept.menubar to gui.menubar.
  Renamed textadept.print() to gui.print().
  Renamed textadept.size to gui.size.
  Renamed textadept.statusbar_text to gui.statusbar_text.
  Renamed textadept.switch_buffer() to gui.switch_buffer().
  Renamed textadept.title to gui.title.
* Other miscellaneous changes:
  Renamed textadept.new_buffer() to _G.new_buffer().
  Renamed textadept.quit() to _G.quit().
  Renamed textadept.reset() to _G.reset().
  Renamed textadept.user_dofile() to _G.user_dofile().
  Renamed textadept.iconv to string.iconv.
  Renamed textadept.session_file to _SESSIONFILE.

As a result, the global 'textadept' module does not exist anymore.

This has a number of consequences:
* User's init.lua can be less complicated, either requiring just
'textadept' or copying the 'require' statements from only one place:
modules/textadept/init.lua.
* Most scripts on the wiki will have to be updated.
* The current releases will not be compatible.

This API can be viewed here: http://caladbolg.net/luadoc/textadept3/index.html

Comments are welcome.
Received on Sun 13 Jun 2010 - 00:10:43 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:47:40 EST