[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using incremental parsing in Emacs
From: |
Stefan Monnier |
Subject: |
Re: Using incremental parsing in Emacs |
Date: |
Mon, 06 Jan 2020 08:47:31 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> I see the buffer is fontified correctly. Does it parse the whole buffer?
We have different levels of parsing. At the bottom we have
`syntax-ppss` (whose workhorse, implemented in C, is
`parse-partial-sexp`) which only counts parentheses and looks for
comment and string markers. In the above case, `syntax-ppss` indeed
parses the whole buffer, but given its limited scope this parsing is
usually fast (it can be slow in some cases, because `parse-partial-sexp`
is supplemented by `syntax-propertize-function` to handle the "unusual"
cases of "strings/comments" (a typical example would be here-documents
in shell scripts) and this is all implemented in Elisp using regexp
searches).
After this parsing is done, font-lock looks at the few lines actually
displayed using its Elisp/regexps rules to apply the actual highlighting.
This may look at more parts of the buffer, tho, depending on the actual
font-lock rules.
Stefan
- Re: Using incremental parsing in Emacs, (continued)
- Re: Using incremental parsing in Emacs, Eli Zaretskii, 2020/01/05
- RE: Using incremental parsing in Emacs, arthur miller, 2020/01/05
- Re: Using incremental parsing in Emacs, Eli Zaretskii, 2020/01/05
- Re: Using incremental parsing in Emacs, HaiJun Zhang, 2020/01/05
- Re: Using incremental parsing in Emacs, Eli Zaretskii, 2020/01/06
- Re: Using incremental parsing in Emacs, HaiJun Zhang, 2020/01/06
- Re: Using incremental parsing in Emacs, Eli Zaretskii, 2020/01/06
- Re: Using incremental parsing in Emacs, arthur miller, 2020/01/06
- Re: Using incremental parsing in Emacs, Eli Zaretskii, 2020/01/07
- Re: Using incremental parsing in Emacs, arthur miller, 2020/01/08
- Re: Using incremental parsing in Emacs,
Stefan Monnier <=
- Re: Using incremental parsing in Emacs, HaiJun Zhang, 2020/01/06
- Re: Using incremental parsing in Emacs, arthur miller, 2020/01/06
Re: Using incremental parsing in Emacs, Anand Tamariya, 2020/01/06
RE: Using incremental parsing in Emacs, HaiJun Zhang, 2020/01/03