Subject: Re: bug#22983: [ Patch ] Re: bug#22983: syntax-ppss returns wrong result.

From: Alan Mackenzie <[email-masked]>
Date: Mon, 18 Sep 2017 19:08:47 +0000

Hello, Dmitry

On Mon, Sep 18, 2017 at 02:43:05 +0300, Dmitry Gutov wrote:
> Hi Alan,

> On 9/17/17 1:29 PM, Alan Mackenzie wrote:

> > I don't know anything about these things.  But seeing as how syntax.el is
> > preloaded, the definition of structs would need to be preloaded earlier.

> OK, let's do without that for now. The result doesn't look too bad to my 
> eyes, at least.

> >>>> Would you like to see the code?

> >>> Yes, why not?

> >> Please give me until the end of the week.

> > The end of the week has arrived.  Are you still intending to propose an
> > alternative formulation of the new cache manipulation for syntax-ppss?

> Thanks for the reminder. The patch is attached. I've tested it 
> minimally, any feedback is welcome.

Thanks for this.  I'm impressed.  Your syntax-ppss--data is far more
elegant than my syntax-ppss-set-cache.  The burden of carrying around
the caches in cons cells is much less than I had feared.  The amendments
to syntax-ppss are also less than I had feared, amounting to little more
than substituting "syntax-ppss-cache" with "ppss-cache" etc., and making
a few bindings to support that.

I notice you flush both caches eagerly, as you said you would.  No harm
in that.

So, I'm willing to go with your version.  I haven't tried actually
running it, yet.

But there's one small change I would ask you to consider making - that
is, in the cache conses, to put ppss-last in the car and ppss-cache in
the cdr.  That way, while debugging, ppss-last will be easy to find
(it's the first element of the list) and ppss-cache will also be easy to
find (the second element onwards).  

> (It reads much better in Emacs with diff-auto-refine-mode).

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).