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: Thu, 15 Dec 2022 21:03:56 +0100 Message-ID: <87v8mczb6b.fsf@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> <4315EFC6-7AA8-4A48-845C-9CA8B88034D9@thornhill.no> <87bko521n0.fsf@thornhill.no> <87359h1ybt.fsf@thornhill.no> <871qp01msi.fsf@thornhill.no> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12570"; 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 Thu Dec 15 21:04:49 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 1p5uTJ-00033G-75 for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Dec 2022 21:04:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5uSc-0003D8-W8; Thu, 15 Dec 2022 15:04:07 -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 1p5uSY-0003Cm-Q0 for emacs-devel@gnu.org; Thu, 15 Dec 2022 15:04:05 -0500 Original-Received: from out-122.mta0.migadu.com ([91.218.175.122]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5uSV-0002lz-GY for emacs-devel@gnu.org; Thu, 15 Dec 2022 15:04:02 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1671134637; 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; bh=1yIjYrFOrD2g8QXyyNdOlAQz5R2WuBVwIreKP7SdHKI=; b=lAcakcKz0lmvYOZcpuMRfXO2Kw1ECOV6AZW/wc+znaci9yxML7Qi06zgiXMSN0PMt2vWnh AyqtaimiAwGsIRBaYW3Lln3oSp/UfPrzRDvsRiXsIgbzIaEP2C0wV7LGZyknMMaho7ZCvu aQhXQ7jE9sGK0blbsFInMakiL3WNb8VCaQFigMUMTCd/W2BVLvp3Pz/XbNqSU+cuoGdGiP /vCBaJu+aUCj0Fp531E1bra0vGYF9gLeAOdZ7qWQcwVq56Yc5EZIT1aL5b+ybkSNpHDpF1 Gp7AJQEwMTYgvrall3/iYgN9bkW3aaymw1J4Psx9zo6OIFbD1VJ8Lb3naMkrMQ== In-Reply-To: X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=91.218.175.122; envelope-from=theo@thornhill.no; helo=out-122.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:301467 Archived-At: Stefan Monnier writes: >> If this code is plugged into transpose-sexps we get this nice behavior: > > It's a bit different from what SMIE would do, but there's a lot of > overlap and when it's different it's arguably better, so sounds good > to me. > Great! >> Now forward/backward-sexp can actually work a little differently, as you >> suggest, or we can let it use the same "move over siblings"-semantic. >> In that case we don't even need the treesit-sexp-type-regexp variables to >> control this, I think. >> >> What do you think? > > I'm not sufficiently familiar with the tree-sitter tree to foresee > precisely how it would affect `forward/backward-sexp`, but I think you > have a good enough understanding to make a good judgment at this > point :-) Great. I'll prepare a patch for this behavior, and we can discuss the forward-* commands after that. Theo