Re: [code] I need help adding a language-specific snippet

From: Mitchell <>
Date: Mon, 6 May 2013 08:29:35 -0400 (Eastern Daylight Time)


On Mon, 6 May 2013, Russell Dickenson wrote:

> Mitchell,
> I have modified my ~/.textadept/modules/xml/init.lua file, trying both of
> the forms you suggested earlier in this email thread.
> Regardless of which I choose, I get the following error message when I open
> an XML file:
> /usr/lib64/textadept/modules/textadept/mime_types.lua:95: attempt to index
> field '?' (a boolean value)
> In this case I have packaged Texadept 6.6 beta for Fedora 18 and installed
> the resulting package. I have tested and confirmed that I get the same
> error message even if using the pre-built binaries.

Sorry for overlooking this. If you are trying to create an xml module
(which it seems you are by creating init.lua), then that file must return
a Lua table (a characteristic of a module). So at the end of your
init.lua, add "return {}" since you do not have any special features.
However, if you plan on adding them (such as XML-specific buffer
properties or any XML-specific functions), then you would wrap everything
in a "local M = {} ... return M" construct. For example:

   snippets.xml = {
     ['hi'] = 'hello there'

   return {}


   local M = {}

   function M.set_buffer_properties()
     -- buffer-specific properties like indentation here

   snippets.xml = {
     ['hi'] = 'hello there'

   return M


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Mon 06 May 2013 - 08:29:35 EDT

This archive was generated by hypermail 2.2.0 : Tue 07 May 2013 - 06:34:30 EDT