unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Help needed with query
@ 2022-12-10 14:43 Perry Smith
  2022-12-10 16:02 ` João Paulo Labegalini de Carvalho
  0 siblings, 1 reply; 3+ messages in thread
From: Perry Smith @ 2022-12-10 14:43 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 923 bytes --]

Can someone help explain constructs like this?

           ((query "(for_statement initializer: (_) @indent)") parent-bol 5)

This rule is coming from the indent rules for c-ts-mode.

I’m doing:

           ((query "((method_parameters \"(\" _ @indent))") first-sibling 1)

and it seems to be working for me.

Two questions:
    •
The ‘_’ seems to be a “match all” but I’m currently using just ‘_’  and not ‘(_)’ and it seems to be working for me.  What is the difference?
    • The @indent seems to be necessary to get the query to match.  Things do not seem to match without it but it doesn’t need to be @indent… it can be @foo.  So, what is it doing and does the name matter?


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.

Thank you for your time,
Perry


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-10 17:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-10 14:43 Help needed with query Perry Smith
2022-12-10 16:02 ` João Paulo Labegalini de Carvalho
2022-12-10 17:31   ` ***SPAM*** " Perry Smith

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).