Re: [code] Odd behaviour in v9.1 split views

From: Michael Richter <ttmrichter.att.gmail.com>
Date: Fri, 3 Feb 2017 02:09:13 +0800

OK, solved my particular issue, but it brings up the old problem of error
reporting in lexers.

Basically if the lexer is invalid for any reason, Textadept just throws up
its hands and gives up. In this specific case, though, it throws up its
hands and gives up in a hissy fit that screws with the formatting of all
subsequent view splits, etc. in perpetuity. And the reason I didn't notice
this is because Textadept doesn't deign to inform me when a lexer is bad.

My gas lexer was an old one (pre-8.0, IIRC) that I hadn't updated to take
into account some of the changes to the lexer support. To wit, I had a
module (lexer_tools) that I used to provide me with some decently-named
functions in place of the complicated and vaguely incoherent LPEG naming
conventions. (E.g. local maybe = function(p) return p^-1 end). As of 8.0
these stopped working ... when in separate modules. So this code sequence
always failed:

local lt = require 'lexer_tools'
local maybe = lt.maybe

...

--[[do something with]] maybe(P':') -- and so on

But if I take the maybe function from lexer_tools and put it into the
lexer's source file it all works as expected.

Now I hadn't touched gas code in a while, so I didn't update the gas lexer
-- and I forgot about that issue. The malfunction was triggered by
invoking the (broken) gas lexer. The solution was to manually bring in
those lexer_tools functions.

Would it be possible to get some kind of error reporting from the lexer
instead of the current silent failure? It would make debugging these kinds
of problems much simpler.

On 3 February 2017 at 00:36, Michael Richter <ttmrichter.att.gmail.com> wrote:

> Even more interesting, I'd noted that the "gas" lexer file was missing
> (I'd done some housecleaning). When I replaced it, same problem. Even
> when it's replaced with an empty file it's the same problem.
>
> I'll have to investigate closer.
>
> On 3 February 2017 at 00:33, Michael Richter <ttmrichter.att.gmail.com> wrote:
>
>> Interesting.
>>
>> This is the offending code:
>>
>> textadept.file_types.extensions.inc = 'gas'
>> textadept.file_types.extensions.s = 'gas'
>> textadept.file_types.extensions.S = 'gas'
>> textadept.file_types.patterns['ft=gas'] = 'gas'
>>
>>
>> On 2 February 2017 at 21:45, Mitchell <m.att.foicica.com> wrote:
>>
>>> Hi Michael,
>>>
>>> On Thu, 2 Feb 2017, Michael Richter wrote:
>>>
>>> On 1 February 2017 at 13:52, Mitchell <m.att.foicica.com> wrote:
>>>>
>>>> Hi Michael,
>>>>>
>>>>> On Tue, 31 Jan 2017, Michael Richter wrote:
>>>>>
>>>>> Nope. None of any kind. I hook LEXER_LOADED and I emit UPDATE_UI for
>>>>> one
>>>>>
>>>>>> key binding.
>>>>>>
>>>>>>
>>>>> I'm having a mental block and cannot think what it might be. If you
>>>>> are on
>>>>> Linux would you humor me and run `textadept -f -u /tmp`? That will run
>>>>> Textadept with a clean `_USERHOME` (in /tmp). If you can still
>>>>> reproduce,
>>>>> then it would appear to be a Textadept issue.
>>>>>
>>>>>
>>>> This causes no weird problems.
>>>>
>>>
>>> Okay, so then something in your ~/.textadept/ is causing the issue.
>>> You'll probably have to debug this the old-fashioned way by process of
>>> elimination.
>>>
>>>
>>> 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.
>>>
>>>
>>
>>
>> --
>> "Perhaps people don't believe this, but throughout all of the discussions
>> of entering China our focus has really been what's best for the Chinese
>> people. It's not been about our revenue or profit or whatnot."
>> --Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.
>>
>
>
>
> --
> "Perhaps people don't believe this, but throughout all of the discussions
> of entering China our focus has really been what's best for the Chinese
> people. It's not been about our revenue or profit or whatnot."
> --Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.
>

-- 
"Perhaps people don't believe this, but throughout all of the discussions
of entering China our focus has really been what's best for the Chinese
people. It's not been about our revenue or profit or whatnot."
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.
-- 
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 Thu 02 Feb 2017 - 13:09:13 EST

This archive was generated by hypermail 2.2.0 : Fri 03 Feb 2017 - 06:43:59 EST