From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Plug treesit.el into other emacs constructs Date: Tue, 13 Dec 2022 11:53:18 -0800 Message-ID: <04BB786A-3ED1-4918-8583-17AA01A1E453@gmail.com> References: <87wn6whete.fsf@thornhill.no> <87r0x3gnv5.fsf@thornhill.no> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6159"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Theodor Thornhill , emacs-devel@gnu.org, eliz@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 13 20:54:16 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 1p5BM0-0001RE-4z for ged-emacs-devel@m.gmane-mx.org; Tue, 13 Dec 2022 20:54:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5BLE-00020I-Jo; Tue, 13 Dec 2022 14:53:28 -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 1p5BLC-000207-E3 for emacs-devel@gnu.org; Tue, 13 Dec 2022 14:53:26 -0500 Original-Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p5BLA-0001A6-Lc; Tue, 13 Dec 2022 14:53:26 -0500 Original-Received: by mail-pj1-x1034.google.com with SMTP id z8-20020a17090abd8800b00219ed30ce47so4701542pjr.3; Tue, 13 Dec 2022 11:53:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=iAJRWDGc5uTlo6JGf/Gqq8sQMXRu91wqd3dA+2888qo=; b=ny4X812EbA9H70OlX+xnWErevl407FBDzYJMeKC5tM1fhQOToB7NulOrSw45ALucug 4HdGgFMfihYXrkfcSmU9yalGU5dhU0On5JCFwT8KVyAO1ImSmAp6xoJpBvzJxo1X+Ybc BZqL+pcLb12gl6CyD0WKP1oU3kKmdQAYN6U7a+EXqbweuzYoH6n5MXbpUXRUSu1ZNvtI wPN+i0HZMmCYd1DOae3uFvKbW+qxDcqB++2NWkUcd0aVDddqGeapcP1u5XhxUupVgX9P I2F0hqsvSvCxMulJKaE5Rxnyqh9PuPTyXx8X2pURDV8N5IQqaHwl9F0pFGSEkVkhvJLu eLtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iAJRWDGc5uTlo6JGf/Gqq8sQMXRu91wqd3dA+2888qo=; b=An235c2F9eq/DDv3YeLxfbMxb32PN2QgzxIYUChnJhQPVznQT3s3pM8grk7Jd7N5Vq H3il/6/oK3DpUVuiChKl1FEArjKl8q8QG+ub/nPaMX7zugCcQpkVuJMWXs7c8ziY83+h NTessqIAp4MnEiX5Ve501bwSVbdMj5wDrcpn4bsB5/pdecQZgcPg6nNmtM/EEogLAscA NseRIk0yj+WBcWP/7P5UJz3OcGmWl5B0b7Bv7j8j9M/QzqWrTrFcd+wEmO13LpV8SmdC 790gkZRdNdMz9JtSGpiruQsqDa91uhC0SHJPv7mQa4JE2uve1+1+Qu+sQa6GfK+9Na7r NssQ== X-Gm-Message-State: ANoB5ploXGTs3fe4saXjMQjHD8kBY/GZMwtBd6K+bbhNSSoJzPQpHhYA 0KW0pdaj0bcCoCCOuiZvlTo= X-Google-Smtp-Source: AA0mqf5c91FtqzzgF0kSP3rFKWjZRYim1o5HcB5jEhlvVGe4L3WdV1R4yzT44yVWVqYuV2GRZhuSlw== X-Received: by 2002:a05:6a20:6f06:b0:a2:bc99:ab98 with SMTP id gt6-20020a056a206f0600b000a2bc99ab98mr24261599pzb.28.1670961200909; Tue, 13 Dec 2022 11:53:20 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id 73-20020a63064c000000b0047915d582ccsm7153356pgg.20.2022.12.13.11.53.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Dec 2022 11:53:20 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=casouri@gmail.com; helo=mail-pj1-x1034.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:301356 Archived-At: >=20 >> I mean, what construct is each one expected to jump over? >=20 > In my book "sexp" movement should jump over subtrees of the AST. It=E2=80=99s pretty hard to judge which subtree to move over at a given = point in an AST. For example, when point is at | in the following text: (|X.y(z), alpha) Should point move over X, or X.y, or X.y(z)? All three subtrees has = their beg=3D(point). A human can tell (and might disagree on) which unit = to move across, but a program couldn=E2=80=99t tell. Without language = specific knowledge, it can=E2=80=99t really decide.=20 Just a thought, but maybe we can let major modes define what=E2=80=99s = an =E2=80=9Cabstract list=E2=80=9D, and sexp-forward would move across = the immediate children of abstract lists. Eg, abstract lists in C would = contain block, argument list, statement, etc. And in the example above = forward-sexp would move across X.y(z) because it=E2=80=99s an immediate = children of the enclosing abstract list, the argument list. Yuan=