[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Recent updates to tree-sitter branch
From: |
Ihor Radchenko |
Subject: |
Re: Recent updates to tree-sitter branch |
Date: |
Sat, 01 Oct 2022 12:20:46 +0800 |
Yuan Fu <casouri@gmail.com> writes:
>> Will the currently matched node be passed to the function? Or should the
>> function run yet another query to determine the node it was called on?
>
> The matched node is passed to the function.
Thanks for the clarification! I missed this detail in the documentation.
>> OVERRIDE can also be 'prepend or 'append to combine faces from multiple
>> nodes.
>
> You can’t really pretend or append if the only face format we allow is symbol.
Why?
'prepend implies that if there is an existing font-lock-face, the new
face will be prepended to it. Note the 'face text property may contain a
list of faces:
‘face’
The ‘face’ property controls the appearance of the character (*note
Faces::). The value of the property can be the following:
...
• A list of faces. Each list element should be either a face
name or an anonymous face. This specifies a face which is an
aggregate of the attributes of each of the listed faces.
Faces occurring earlier in the list have higher priority.
>> Also, OVERRIDE nil will not apply fontification on the already fontified
>> parts of the region. Note that the parent node might only fontify
>> fraction of the text inside the child node. The parts not yet fontified
>> can make use of OVERRIDE nil.
>
> Ok, I guess it’s good to have options. But I think it is more intuitive and
> convenient to override by default.
I disagree. The current default in font-lock-keywords is not to
override. If programmatic font-lock behaves differently, it will be
confusing.
--
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92
- Re: Recent updates to tree-sitter branch,
Ihor Radchenko <=