[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: forward-comment and syntax-ppss
From: |
Alan Mackenzie |
Subject: |
Re: forward-comment and syntax-ppss |
Date: |
Thu, 8 Dec 2016 20:15:17 +0000 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
Hello, Stefan.
On Wed, Dec 07, 2016 at 09:32:50PM -0500, Stefan Monnier wrote:
> > Read up on bug #22983. Basically, syntax-ppss is fundamentally broken.
> > It won't work with narrowing of buffers, and delivers inconsistent
> > results which aren't in accordance with what the function's doc says it
> > does. This breakage isn't anything that can be fixed.
> > The only way to deal with it seems to be to remove syntax-ppss and
> > replace it with a new function.
> And how would the new function not face the same breakage that can't be
> fixed?
It would have a sensible definition. "Returns the equivalent of
(parse-partial-sexp (point-min) POS)" is a silly definition which cannot
be coded up in any reasonable fashion. I think it should be replaced by
"returns the equivalent of (parse-partial-sexp 1 POS)", which can be
readily implemented. I propose, additionally, a new buffer local
variable which, if non-nil, will contain a buffer position to use in
place of the "1".
> As you should know, your comment-cache code suffers from the exact same
> problem.
Rubbish. Modulo any remaining bugs, it does what it says it does.
> It's a fundamental problem in caching parsing data in the face of
> narrowing, given the fact that our narrowing primitive don't say what
> is the intention behind it.
Nor should it. Our primitives `car', `cdr', `list', etc. also don't say
what the intention behind them is; they just work. Narrowing is what it
is. Simple and austere. Complexifying narrowing by introducing a
notion of "intention" would surely make it more difficult to use and
possibly foul things up massively.
> If you think your comment-cache works well (i.e. you consider its
> failures ....
What failures? If you've found any, please tell me specifically what, so
that I can fix it/them. Please stop spreading FUD like this.
> .... to be caused by inappropriate use of narrow-to-region), then it's
> trivial to "fix" syntax-ppss in the same way: just put a `widen` in it
> and voilà: "fundamentally broken" solved.
Rubbish again. "Returns the equivalent of (parse-partial-sexp
(point-min) POS)" cannot be implemented in any reasonable fashion, and
just putting a `widen' into the current code won't change that one bit.
As I said above, I think syntax-ppss should be retired and replaced by a
function which does parse-partial-sexp starting at 1 rather than
(point-min).
> Stefan
--
Alan Mackenzie (Nuremberg, Germany).
- Re: forward-comment and syntax-ppss, (continued)
- Re: forward-comment and syntax-ppss, Andreas Röhler, 2016/12/07
- Re: forward-comment and syntax-ppss, Stefan Monnier, 2016/12/07
- Re: forward-comment and syntax-ppss, Andreas Röhler, 2016/12/07
- Re: forward-comment and syntax-ppss, Clément Pit--Claudel, 2016/12/07
- Re: forward-comment and syntax-ppss, Alan Mackenzie, 2016/12/07
- Re: forward-comment and syntax-ppss, Clément Pit--Claudel, 2016/12/07
- Re: forward-comment and syntax-ppss, Alan Mackenzie, 2016/12/08
- Re: forward-comment and syntax-ppss, Clément Pit--Claudel, 2016/12/08
- Re: forward-comment and syntax-ppss, Eli Zaretskii, 2016/12/09
- Re: forward-comment and syntax-ppss, Stefan Monnier, 2016/12/07
- Re: forward-comment and syntax-ppss,
Alan Mackenzie <=
- Re: forward-comment and syntax-ppss, Clément Pit--Claudel, 2016/12/08
- Re: forward-comment and syntax-ppss, Dmitry Gutov, 2016/12/08
- Re: forward-comment and syntax-ppss, Stefan Monnier, 2016/12/08
- Re: forward-comment and syntax-ppss, Stefan Monnier, 2016/12/08
- Re: forward-comment and syntax-ppss, Alan Mackenzie, 2016/12/09
- Re: forward-comment and syntax-ppss, Stefan Monnier, 2016/12/09
- Re: forward-comment and syntax-ppss, Clément Pit--Claudel, 2016/12/09
- Re: forward-comment and syntax-ppss, Alan Mackenzie, 2016/12/09
- Re: forward-comment and syntax-ppss, Eli Zaretskii, 2016/12/10
- Re: forward-comment and syntax-ppss, Andreas Röhler, 2016/12/10