Re: [code] Error in markdown lexer

From: Mitchell <m.att.foicica.com>
Date: Wed, 13 Nov 2013 10:57:42 -0500 (Eastern Standard Time)

Hi Rena,

On Wed, 13 Nov 2013, Rena wrote:

> When I open an empty file with .md extension in 7.0 I get endless errors:
> /home/rena/.textadept/modules/textadept/menu.lua:374: attempt to index a
> function value
>
> Menu.lua is: http://sprunge.us/ECQF
> Specifically the problem line is: M.set_contextmenu(_M[lang] and
> _M[lang].context_menu or context_menu)
>
> so I suppose _M[lang] is a function in this case? I changed the offending
> line to:
> if _M[lang] and type(_M[lang]) ~= 'function' then
> M.set_contextmenu(_M[lang].context_menu or context_menu)
> else M.set_contextmenu(context_menu)
> end
> and that seems to have fixed it.

`_M[lang]` should always be a language module (hence, a table). `lang`
would be `markdown` in the case of a `.md` file. You are correct that in
your case, `_M.markdown` is a function. Do you have a
`~/.textadept/modules/markdown/` module that returns a function or some
code that sets `_M.markdown` to a function? I followed your steps on my
machine and could not reproduce.

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 Wed 13 Nov 2013 - 10:57:42 EST

This archive was generated by hypermail 2.2.0 : Thu 14 Nov 2013 - 06:39:46 EST