From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Perry Smith Newsgroups: gmane.emacs.devel Subject: Re: Plug treesit.el into other emacs constructs Date: Tue, 13 Dec 2022 14:06:56 -0600 Message-ID: References: <87wn6whete.fsf@thornhill.no> <87r0x3gnv5.fsf@thornhill.no> <04BB786A-3ED1-4918-8583-17AA01A1E453@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.110.1.12\)) Content-Type: multipart/signed; boundary="Apple-Mail=_37D99139-DFEF-4B94-B3F3-429FE4AD1B6D"; protocol="application/pgp-signature"; micalg=pgp-sha256 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37439"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , Theodor Thornhill , emacs-devel@gnu.org, eliz@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 13 21:08:09 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 1p5BZQ-0009UN-FO for ged-emacs-devel@m.gmane-mx.org; Tue, 13 Dec 2022 21:08:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5BYj-0005xm-A6; Tue, 13 Dec 2022 15:07:25 -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 1p5BYg-0005xV-UK for emacs-devel@gnu.org; Tue, 13 Dec 2022 15:07:22 -0500 Original-Received: from antelope.elm.relay.mailchannels.net ([23.83.212.4]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5BYe-0004j0-Ur; Tue, 13 Dec 2022 15:07:22 -0500 X-Sender-Id: a2hosting|x-authuser|pedz+easesoftware.com@mi3-ss4.a2hosting.com Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id B95A6540F30; Tue, 13 Dec 2022 20:07:17 +0000 (UTC) Original-Received: from mi3-ss4.a2hosting.com (unknown [127.0.0.6]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id C2F0054112E; Tue, 13 Dec 2022 20:07:08 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1670962029; a=rsa-sha256; cv=none; b=BOPSW/6AjluDWqP7j10baSk577K+FnzU610Gc7y6+uHZWpFQuH4Pk8mqnpIpl5AC7PDc6M t4mmeaw4vLp3XerTL/Uj0DO32EcP9mz5pmjfksmYwpr8SM0ugi2ChmNsIKGpx8722NaMEt 6f12XTx/TVFxVrCMZDceyC8/DAKQFEZtG/IQXSI56UaqANP6+grvJbjQS2G98IGNrNXe7V miDCfivlBqRl6Dh186uY+nutLJMjPgHbSsgmc3LOybya99J0AsSQgSJRiEjYRSEX42bVEi vrnBlNWUyVYBJZP0NimBbJ/6Cv8oTOWbqUZ7acLz5qIthSqFknRVW06VFYg8Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1670962029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=R/v2Bmic/VQOYRZ0699DF7WGNlbkvO06VkjHHEF+gE4=; b=VIXsxFEx1lvOzth07/1VGmUWHHVUaLgEe7/Hd9HGXMZ+WQ+6wzgL4/2EGXtrbjPAMHBOQv 2fu4s7AtoqqzaAxtcCnMXlcXpRlmadPForRU51FDn4vyGlo8bF7vTtF/3mLZRodTYXPsC+ tmLMwvay9RSTeWJvwJBM4vHIjrPbA5KXTs1JC1uYGcjacWXSyrvzODOgBskZUDTyYJLbZR 4sOHRIKE0HSnHEKf9RmSefXhTX54/F4DvP4BMPBTVk02hGQ/O1gn8HipAgpEj1K13oc29X Spgg8jHsuTv9grfGeZmjvj97qPe/mo7rNhS85unOjPWTQWi5fN2RYJpbQn+oEQ== ARC-Authentication-Results: i=1; rspamd-d48c5ddb-b6v62; auth=pass smtp.auth=a2hosting smtp.mailfrom=pedz@easesoftware.com X-Sender-Id: a2hosting|x-authuser|pedz+easesoftware.com@mi3-ss4.a2hosting.com X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|pedz+easesoftware.com@mi3-ss4.a2hosting.com X-MailChannels-Auth-Id: a2hosting X-Turn-Relation: 02b4528f1be3f92f_1670962037404_1703187447 X-MC-Loop-Signature: 1670962037404:3820844541 X-MC-Ingress-Time: 1670962037404 Original-Received: from mi3-ss4.a2hosting.com (mi3-ss4.a2hosting.com [68.66.200.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.109.138.16 (trex/6.7.1); Tue, 13 Dec 2022 20:07:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=easesoftware.com; s=default; h=To:References:Message-Id:Cc:Date:In-Reply-To :From:Subject:Mime-Version:Content-Type:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=R/v2Bmic/VQOYRZ0699DF7WGNlbkvO06VkjHHEF+gE4=; b=QkaBFe8xJ5MVLAcFWeUxbmjout wC994/ZwC7FzY/5HHZgBzdvLvCfqTt7CZIBaeNuJdxeu+FiwFHFgC1kPlh0yZIP1Hjxik3DQWFMh7 FCkldKQj71zdiTk6GZTal8sFcnlqx/ErIeDZcrt12tuynvZcJfU+3gDJOpRISjJ3tdlQFj7BZZSeT BYfGmOBs07L0XgaD7fPn1scVJNCXk50HzJykPTPEXv1Y60r5M8J+cV+Rm0c/FrhdtYpxmSfZrx8rV CZT9294z4ScXtm9BJD4EFBQgJyeWZsCswou73h6D1bFsLVbkmkMR92BL9Tc0vQ3xOlzSvta/MPSyh bwq7NbDA==; Original-Received: from cpe-70-94-128-193.satx.res.rr.com ([70.94.128.193]:53888 helo=smtpclient.apple) by mi3-ss4.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1p5BYR-00GZmu-Po; Tue, 13 Dec 2022 15:07:07 -0500 In-Reply-To: <04BB786A-3ED1-4918-8583-17AA01A1E453@gmail.com> X-Mailer: Apple Mail (2.3731.200.110.1.12) X-AuthUser: pedz+easesoftware.com@mi3-ss4.a2hosting.com Received-SPF: pass client-ip=23.83.212.4; envelope-from=pedz@easesoftware.com; helo=antelope.elm.relay.mailchannels.net 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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:301359 Archived-At: --Apple-Mail=_37D99139-DFEF-4B94-B3F3-429FE4AD1B6D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 13, 2022, at 13:53, Yuan Fu wrote: >=20 >>=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. >=20 > 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: >=20 > (|X.y(z), alpha) >=20 > 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. How about this: Most languages have a well known precedence for operators and usually = these are documented with words like =E2=80=9Cadditive operators=E2=80=9D,= =E2=80=9Cmultiplicative operators=E2=80=9D, etc. The difference between X, X.y, and X.y(z) I would say are likely known = to the user. In other words, they are probably thinking =E2=80=9CI want = to move past the function call=E2=80=9D or more reasonably, =E2=80=9CI = want to move to the next parameter=E2=80=9D. With some thought, a keymap could be devised so that -p would = move to the next parameter, -m would move past the = multiplicative subexpression. --Apple-Mail=_37D99139-DFEF-4B94-B3F3-429FE4AD1B6D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE5yOa/gCtQpb3oCpljxzk9yzE+MAFAmOY22AACgkQjxzk9yzE +MDi7xAA09TWImSqWrdyyskmlwfuJY8pO07rY6jjSifOIYguApJo3JJ3KcfAXjbO x7euT7TbIGGjXsmK6tTOE7vsRMvCxSY7VmhJvH7T4Ks+CtkOPS+XS9B2KsiZBjuq UF4Z5qarpfCL+QVtC4xWFUPsQYbd9hOF7L6PxDODWNRRMajFZ/j/gzThPQO8Cp23 nTchXbTSN72S9OlLP5h2sBeoqCuuZNt4vUIyqRNF3DbXsv7IDKXifE6EErFGGone 4iAqouW7xnbJVnke5QPCU9thyUbUmkLi7OhAwI1neNfXYkmkmqb6qYxFsA6NgTLb sWT1yHdzaBAK+8PTJg1QFEpz82VvVgL/WnDkbyk9FWK+Y9NLAx+bGvYmR+FHAkkC +H83MFl77gGt/OTQhgtpXde+aL+MIWWFmK6I/3d8TOW6p2zXJqyhWNEp9owG4OMJ QYHSF680JszxG4/BHx4zOGhSEwYxJcibE2IQMcaOWVSkQXR0cfV/o7zYkmsiTS3T wOg8kH49d5P6RgDmERT/n6JTXAio9tDNz3GNSi/v5E9cnjW7pQItvs6neoWgZA75 zx2M6Ogmbqwt9CmfsvLVNQUkQdSvHMpCjjx/52h03vZJ+DOBHwjJNRNS4CO6JKdk 4kYoIoHlY8Hn7JKpHtM/HcffsDnPizJxT4owLzPze6YWvwuyif0= =dj6y -----END PGP SIGNATURE----- --Apple-Mail=_37D99139-DFEF-4B94-B3F3-429FE4AD1B6D--