From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter documentation Date: Tue, 8 Nov 2022 07:36:43 -0800 Message-ID: References: <48A65188-BBC6-442F-A552-5FEA1416F936@gmail.com> <83a653ynec.fsf@gnu.org> <14DDD315-2399-41F7-B1C6-10433C27CF5C@gmail.com> <83h6z9y0fa.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25218"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii , Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 08 16:37:31 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1osQfL-0006Jj-8P for ged-emacs-devel@m.gmane-mx.org; Tue, 08 Nov 2022 16:37:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1osQeg-0002YG-R8; Tue, 08 Nov 2022 10:36:50 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osQed-0002Xy-GX for emacs-devel@gnu.org; Tue, 08 Nov 2022 10:36:47 -0500 Original-Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1osQeb-0002a4-FB; Tue, 08 Nov 2022 10:36:46 -0500 Original-Received: by mail-oi1-x234.google.com with SMTP id q186so3478977oia.9; Tue, 08 Nov 2022 07:36:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=cZ1+MgiN5xv0c5hWCWu1hL3NVDgAOgQVXe3j9Tv1TUw=; b=mErwhHG9C/9+d5MWEIUnQ6jDPMSNzurRp6YTALbnRZmiUI3cz1HfJwQ7e9pq/6tSRn zi4mf+hQpJ66E6bEFpsriuQ8Ar3nwyMZHtIMw/jslPkDBYIywISXYBbuv3BZN1VLUsin Fh4ZwknbrA6tzwep3zJM02bvKWmXzHo7OrKP/Qt7MiNVBi03I4s7iOHT9GzOHKTD5M/M LK41tH3v3UTWg2JmmkNkece1NEDWuAfLVcishwSOK4ovOwUEVyJTF4YM0MvDXRM4k4MT Iv8kIKnfHuWuGMoUfkg64NtVodMrX3czWmyI+dT10BkHBZSETS+KrJtTKwgbSCVdLCHE KzuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cZ1+MgiN5xv0c5hWCWu1hL3NVDgAOgQVXe3j9Tv1TUw=; b=IaGFLUHXCtQCR3k7nKUbaZI0sMCzIwvnBdPCtByAQmU10GYzunlMMtz6fbQWNPU1UT uDc2fxzARTEquXNA6KtJg+LVZ87t8+yuqEBf5GFTKUCxbMCz8/fpC3yVeeWnVj183FTY UyTUdhXZft8MfqVIaW57gc75ZBjVTYpomVtFE82CTUMC9lChLytG6LFTosdhgwcmf4sa 1nW91uYgs7FmBf79PsdKecnSEHVgIgGAHMo/FfDLjmLwRO5iUG7tbgZh3JVY4iZrsu+7 l8kaKpXGVyY/cKWnQdecEjnIVpFD2vl62mcV49QTpCMeQlr/wjKSh6+t6NEbtm5R06Ie D1oQ== X-Gm-Message-State: ACrzQf3F+N6iI1iSEBvtj0E5uN6Chpy1RMGSdcv3ckpNiJYF8VqOIYgF OYTq4QpIx0sRM4Pr0S7obHtWvxYMY5UQZsBo7e8NLWTV X-Google-Smtp-Source: AMsMyM7WxWruomSrHHsfCEZZ/6+U3BwYUikxzIDWHIhuW/6VicTkQe+eNsjowSm6vv9vhYuABh2cYZVLcY9jyTyEuec= X-Received: by 2002:a05:6808:1186:b0:353:b77a:a481 with SMTP id j6-20020a056808118600b00353b77aa481mr39176477oil.199.1667921803923; Tue, 08 Nov 2022 07:36:43 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 8 Nov 2022 07:36:43 -0800 In-Reply-To: <83h6z9y0fa.fsf@gnu.org> X-Hashcash: 1:20:221108:casouri@gmail.com::ZqSXoAKECKXEPPax:7z6W Received-SPF: pass client-ip=2607:f8b0:4864:20::234; envelope-from=stefankangas@gmail.com; helo=mail-oi1-x234.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:299349 Archived-At: Eli Zaretskii 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))))))