all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>, Yuan Fu <casouri@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Tree-sitter documentation
Date: Tue, 8 Nov 2022 07:36:43 -0800	[thread overview]
Message-ID: <CADwFkmkNvght8PirieU27ZpzAuCd3DzjQEdOb6DM7WmTCLYyTg@mail.gmail.com> (raw)
In-Reply-To: <83h6z9y0fa.fsf@gnu.org>

Eli Zaretskii <eliz@gnu.org> writes:

>> Alists has too much layers of parenthesizes that is verbose and easy to get wrong. Compare:

(BTW, they are much easier to edit with something like paredit.
I guess you already use it.)

> I don't share your pessimism about alists.  And the way the functions
> are defined now are also very error-prone and complicate the code,
> which needs to distinguish between several very different signatures.
>
> How about making the query itself the value of a keyword/value pair?
> Like this:
>
>    :language 'python
>    :override t
>    :feature 'string
>    :query '((string :anchor "\"" @python--treesit-fontify-string)
>             (string) @contextual)

I don't mind if it's not a well-formed plist myself, if the last element
is always the query.  It saves some typing.

On that note, I'd probably prefer it if we had something like this:

(treesit-font-lock-rules
 '(;; To avoid repetitive typing:
   (:default t
    :language 'python
    :override t)
   (:feature 'string
    '((string :anchor "\"" @python--treesit-fontify-string)
      (string) @contextual))
   (:feature 'string-interpolation
    '((interpolation (identifier) @font-lock-variable-name-face))))))



  reply	other threads:[~2022-11-08 15:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07 10:13 Tree-sitter documentation Yuan Fu
2022-11-07 12:11 ` Eli Zaretskii
2022-11-07 20:47   ` Yuan Fu
2022-11-08 14:40     ` Eli Zaretskii
2022-11-08 15:36       ` Stefan Kangas [this message]
2022-11-08 18:44       ` Yuan Fu
2022-11-09 13:36         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADwFkmkNvght8PirieU27ZpzAuCd3DzjQEdOb6DM7WmTCLYyTg@mail.gmail.com \
    --to=stefankangas@gmail.com \
    --cc=casouri@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.