emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ***SPAM*** Re: Help needed with query


From: Perry Smith
Subject: Re: ***SPAM*** Re: Help needed with query
Date: Sat, 10 Dec 2022 11:31:56 -0600



On Dec 10, 2022, at 10:02, João Paulo Labegalini de Carvalho <jaopaulolc@gmail.com> wrote:

The capture @indent is used to "mark" the matched initializer for indentation.
 
For instance, when using queries to fontify text, the capture name is either a font-face or a function that returns a font-face.

I knew capture name is used as the face name to fontify text but I can’t find any reference about @indent when used in an indent query — even looking at treesit.el I don’t see anything.  I’m going to try and figure it out empirically.

 I can’t recall now but when I was working on the font lock rules, I needed matching constructs and a type of “match anything except” type of construct.

I am not versed in tree-sitter enough, but I don't recall such a construct. You could write a function that first matches general instances of the construct and then filter out those that have the "undesired"  properties.

I’m reading more and more… turns out:

   It is also possible to capture a node that doesn’t have a certain
field, say, a ‘function_definition’ without a ‘body’ field.

     (function_definition !body) @func-no-body

As always… thank you for your help.

Attachment: signature.asc
Description: Message signed with OpenPGP


reply via email to

[Prev in Thread] Current Thread [Next in Thread]