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: Extending define-derived-mode Date: Mon, 05 Jun 2023 14:33:02 +0300 Message-ID: <83sfb6400h.fsf@gnu.org> References: <20F07C52-6B39-4B24-8433-82E2226EADA6@gmail.com> <83zg5mf62s.fsf@gnu.org> <835y87elec.fsf@gnu.org> <83ilc6axl9.fsf@gnu.org> <85BA8FC1-148C-438B-877A-A06CDCCDE1BF@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11001"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org, mickey@masteringemacs.org, theo@thornhill.no, dgutov@yandex.ru To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 05 13:44:43 2023 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 1q68de-0002eB-5O for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Jun 2023 13:44:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q68SZ-0004S3-VQ; Mon, 05 Jun 2023 07:33:15 -0400 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 1q68SV-0004Mm-Iy for emacs-devel@gnu.org; Mon, 05 Jun 2023 07:33:12 -0400 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 1q68SU-0008Oo-9a; Mon, 05 Jun 2023 07:33:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=oxSVUYHvFTjmHcdRNQ2tenHmcTh25wO9RbkDkBJA7kY=; b=XEc17wlSjFklxuwrR9Td PD7O6z/styy1Vj+VZQEdszJwXyfZqIWd0ZlkRa/ZBoV3kz4lzUNPcK6pgJx3OwWpP0czX+hGVmo6S FCmojsxorKtoErl+Dw8aSo7WTuFgSPiDt8Y0SDBbw988G1vfbWQexliriSs8jDeBq1ptYsPNvlS7o dsRY0Ztmm1dFfXYcISOXcd8auj2PV2vjWbGM2fIEOlKoQ4X5XQ4+9UKkKaleEhR6zI5+bW2xpzcsa /P3ygF9sacMrVVR6xe/+sxPkGQJsHTp+ESYJXU0UZR0aaAnRX51BHkE1GWnX42/6caB/gmUtxbEmd aqlTNyUmy0bbWg==; 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 1q68SO-0004Mu-EF; Mon, 05 Jun 2023 07:33:08 -0400 In-Reply-To: <85BA8FC1-148C-438B-877A-A06CDCCDE1BF@gmail.com> (message from Yuan Fu on Mon, 5 Jun 2023 00:31:02 -0700) 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:306647 Archived-At: > From: Yuan Fu > Date: Mon, 5 Jun 2023 00:31:02 -0700 > Cc: Stefan Monnier , > emacs-devel , > Mickey Petersen , > Theodor Thornhill , > dgutov@yandex.ru > > > For users to be able to share stuff like electric-quote-local-mode > > we'd need to rewrite those supporting modes to allow that. When one > > of the two modes uses regexps and syntax tables, whereas the other > > uses treesit-based parsers, this is not a trivial task. I invite you > > to audit the various electric modes we have and see how many of them > > can be shared with minimum effort between non-TS and TS modes. > > I’m talking about sharing the sharable config. Electric modes already work the same in ts and non-ts modes: electric-pair-mode and electric-quote-mode inserts matching pairs and quotes and aren’t affected by tree-sitter, electric-indent-mode uses the standard indent-line-function which both ts and non-ts modes confront to. Is there any other electric modes? For one prominent example, see the node "Electric Keys" in the CC Mode manual, and the minor modes described in "Minor Modes" there. > Also, ts modes generally have the same syntax table as non-ts modes. So if some package uses the syntax table they are largely not affected either. But it makes little sense to me to have part of a mode use our syntax tables, and another part use the results of parsing the code by a parser library. I can guarantee inconsistencies.