Re: [code] Error in markdown lexer

From: Rena <hyperhacker.att.gmail.com>
Date: Wed, 13 Nov 2013 18:19:33 -0500

On Wed, Nov 13, 2013 at 10:57 AM, Mitchell <m.att.foicica.com> wrote:

> 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.
>
>
I don't have ~/.textadept/modules/markdown/ or
~/.textadept/modules/markdown.lua. I looked at the lexers/markdown.lua
(should be the one extracted from 7.0 archive without any changes) and it
does appear to return a table. The only thing I can think of is something
in my menu.lua, but I don't see anything there that should be causing
issues.

-- 
Sent from my Game Boy.
-- 
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 - 18:19:33 EST

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