From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill Newsgroups: gmane.emacs.devel Subject: Re: Plug treesit.el into other emacs constructs Date: Wed, 14 Dec 2022 19:07:23 +0100 Message-ID: <4315EFC6-7AA8-4A48-845C-9CA8B88034D9@thornhill.no> References: <87wn6whete.fsf@thornhill.no> <87r0x3gnv5.fsf@thornhill.no> <04BB786A-3ED1-4918-8583-17AA01A1E453@gmail.com> <4E3940CA-67A6-45B7-8785-4E60FDECCDFB@gmail.com> Mime-Version: 1.0 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="36628"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu , 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 Wed Dec 14 19:08:55 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 1p5WBY-0009Hr-EN for ged-emacs-devel@m.gmane-mx.org; Wed, 14 Dec 2022 19:08:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5WAc-0006Fb-IW; Wed, 14 Dec 2022 13:07:54 -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 1p5WAX-0006F3-G0 for emacs-devel@gnu.org; Wed, 14 Dec 2022 13:07:52 -0500 Original-Received: from out-85.mta0.migadu.com ([2001:41d0:1004:224b::55]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5WAV-00043z-3X for emacs-devel@gnu.org; Wed, 14 Dec 2022 13:07:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1671041263; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5yRT1Gc69B2RS15f45F501TwQGTE4M4d+xn7SWYAlCI=; b=KXckFTQfmF0ES7fm1iPGgjrBJCWzMxf0kPLed/s4/enUQmR8Jy0HULImvKhz7ycXRDrkBB 5Xcpww9XkTTUjJdVGnlzFd91bYgUjybHcfsS+I68+ZipstBrNJyJN6yLP0O956jB9UVGfO FiKHNKl3BUlSTtxdH+Fq+7BMn9cGvhG5wTQS/bMlCgYjJwfmLDtDCo3Ny30OJKqN+rbtN3 YJ7cFoaH/8gOEz0D2jspeNqSq2lPQgbCsEGE6ItEmZsp38yUumhqhUDW+raIxwvXgps0if WK4P+ftThRIE6YXQedqdukYJTAEO2CXhAg/p+R/TP6PfW3r2Rsz/V6yoJLoCQg== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-Reply-To: X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:1004:224b::55; envelope-from=theo@thornhill.no; helo=out-85.mta0.migadu.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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:301401 Archived-At: On 14 December 2022 18:46:36 CET, Stefan Monnier wrote: >>>and when moving backward it moves from >>> >>> int a =3D 0; >>> int b =3D 1;| >>> >>>to >>> >>> int a =3D 0;| >>> int b =3D 1; >>> >>>> But if we move over the smallest >>>> subtree, I=E2=80=99d imagine it only move across the semicolon after = [1]=2E >>> >> >> Doesn't this look like forward-sentence? > >In this case, yes=2E But in other cases it will move at different levels >of the tree=2E E=2Eg=2E: > > int x =3D f (b + 4, c * 7 - z * 2, d, e); > >It will sometimes move over the whole instruction, and other times over >just a single variable or over a whole argument or over just a "factor"= =2E >This depends on where point is when `forward/backward-sexp` is called=2E Yeah=2E I think this example shows what I find unintuitive=2E If point is = right before the first comma, and we transpose-sexps, it could end up swapp= ing 4 for c * 7 - z * 2, which would rarely make sense in this context=2E S= wapping b + 4 with c * 7 - z * 2 would make sense here, imo=2E I believe th= is is not how you see it?=20 Theo