[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: forward-comment and syntax-ppss
From: |
Stefan Monnier |
Subject: |
Re: forward-comment and syntax-ppss |
Date: |
Thu, 08 Dec 2016 16:47:51 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
> Can parse-partial-sexp parse backwards?
No. Two reasons: one is that we don't have code that (attempts to)
do(es) that, the other is that it's fundamentally difficult/impossible
to do it reliably.
More specifically, the patch "forward-comment and syntax-ppss" is
specifically handling a case where we really don't know how to parse
backward: when moving backward, forward-comment generally tries to find
the beginning of a comment by "parsing backward", but in some cases it
really can't figure it out and (currently) resorts to calling
(parse-partial-sexp (point-min) POS). Since it may potentially do that
for every "comment-end" marker it finds (e.g. every \n in most major
modes), there are pathological cases where the performance in large
buffers can become really poor, hence the need for a cache.
Stefan
- Re: forward-comment and syntax-ppss, (continued)
- 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
- Re: forward-comment and syntax-ppss, Dmitry Gutov, 2016/12/08
- Re: forward-comment and syntax-ppss,
Stefan Monnier <=
- Re: forward-comment and syntax-ppss, Andreas Röhler, 2016/12/09
- Re: forward-comment and syntax-ppss, Alan Mackenzie, 2016/12/09
- Re: forward-comment and syntax-ppss, Dmitry Gutov, 2016/12/09
- Re: forward-comment and syntax-ppss, Stefan Monnier, 2016/12/10
- Re: forward-comment and syntax-ppss, Alan Mackenzie, 2016/12/11
- Re: forward-comment and syntax-ppss, Andreas Röhler, 2016/12/11
- Re: forward-comment and syntax-ppss, Dmitry Gutov, 2016/12/15
- RE: forward-comment and syntax-ppss, Drew Adams, 2016/12/15
- Re: forward-comment and syntax-ppss, Eli Zaretskii, 2016/12/16
- RE: forward-comment and syntax-ppss, Drew Adams, 2016/12/16