From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Plug treesit.el into other emacs constructs Date: Mon, 12 Dec 2022 16:45:33 +0200 Message-ID: <83359ksmsy.fsf@gnu.org> References: <87wn6whete.fsf@thornhill.no> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14495"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, casouri@gmail.com To: Theodor Thornhill , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 12 15:45: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 1p4k41-0003Wh-Ew for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Dec 2022 15:45:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4k3q-0003cZ-83; Mon, 12 Dec 2022 09:45:42 -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 1p4k3o-0003b0-Aw for emacs-devel@gnu.org; Mon, 12 Dec 2022 09:45:41 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4k3n-00064j-Rw; Mon, 12 Dec 2022 09:45:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=868lavomXIqKSya7/O8wSe7FXMhVoo3uJrnxvGxcAIE=; b=T6vYH4cwJsug jMVTDWwFfFXZ9Xb0lLUnjjoIfb2shfnqOI06HQNY/Lt0Xjnm143nffhL4h1pbm2hAfWToVNLHc6zl qWRofAv2cowc3Gp+eoKDGZzcXnNeypswkvbQz7bpI32zhoRamOxw5w6F6+Klycc7C2rzQBVbApDUX kAIfhCC0gX221QGkMkMK9BadIMqDAt5fa7XlZPiiZLYuvl8YTetkPzOkwSv5MNAPurebOIHQxejD/ vIKx8VmEeLaGLOG0xUbw5aLJbsP4O2QnwjRBOIUkc4pXSlNYy9mnRUk0Ke7cbsKMM4ZWN2nnG2/1I Bp6k6A6MJ9EJKnHaOsCpRg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4k3g-0001BM-7l; Mon, 12 Dec 2022 09:45:39 -0500 In-Reply-To: <87wn6whete.fsf@thornhill.no> (message from Theodor Thornhill on Mon, 12 Dec 2022 15:33:33 +0100) 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:301237 Archived-At: > From: Theodor Thornhill > Cc: eliz@gnu.org, casouri@gmail.com > Date: Mon, 12 Dec 2022 15:33:33 +0100 > > The patch only adds a few things: > > - (defvar-local forward-sentence-function nil), the analog to > forward-sexp-function and beginning-of-defun-function > - treesit-sexp-type-regexp and treesit-sentence-type-regexp, both to be > added to treesit-major-mode-setup, and added to each *-ts-mode. > > Is the general idea ok? Yes, because you can see that CC Mode supports these key bindings as well, with its own commands. > Could we add these or similar changes to > paragraphs.el and just piggyback on it inside of treesit? I'm not sure we want to go this far in the release branch, but it would be nice to have these in C mode, for example (or any other tree-sitter supported mode whose "regular" sibling has similar commands). The generalizations should IMO be left for master. > If we want this I can start working on preparing a patch for this on the > master branch. I think so, but let's hear from others, like Stefan (CC'ed).