From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Extending define-derived-mode Date: Fri, 2 Jun 2023 00:50:07 -0700 Message-ID: References: <20F07C52-6B39-4B24-8433-82E2226EADA6@gmail.com> <83zg5mf62s.fsf@gnu.org> <835y87elec.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) 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="27584"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , emacs-devel@gnu.org, mickey@masteringemacs.org, theo@thornhill.no, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 02 09:51:33 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 1q4zZN-0006zj-7V for ged-emacs-devel@m.gmane-mx.org; Fri, 02 Jun 2023 09:51:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4zYj-0000l3-Ie; Fri, 02 Jun 2023 03:50:53 -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 1q4zYV-0000aU-7F for emacs-devel@gnu.org; Fri, 02 Jun 2023 03:50:45 -0400 Original-Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q4zYS-0002fp-KG; Fri, 02 Jun 2023 03:50:38 -0400 Original-Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-1a1b95cc10eso1919651fac.0; Fri, 02 Jun 2023 00:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685692219; x=1688284219; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=CLvh03q9pVMXIPpP+ZJvriO4a0+kFxgqKWhpHWD+GdQ=; b=LvZyN+EJstMPVVhsWpQVTEUob9hmuUpTHo0JgfVjUJOYPezZKzoNyHc/P0YYd8w9M3 KqYx9jUsldnp9VkDG9/JGQqeUkYuOL+fUL5ENgw16VWN8K7tkTAYqtZ+g3pw5uJ1KOBE TPTtakX3wbeudK+itfYm2iw3vYItukhaT0fUVpIeRsAIWIMROLfT1Qy31MSqiTm/xNuu Ld95UVp5eslvkTgqeWWymJrkWsLs2QTH0ZJDqGi0PvrMFxAePc9c3xCGUl6N2f2pLqa3 lyZrctDUQw9CHrnhgsTc8XF8/q+aRh4WjxNdUTqt1xIRVPquvHNLeY7FNT1t8V7ITUWa SKbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685692219; x=1688284219; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CLvh03q9pVMXIPpP+ZJvriO4a0+kFxgqKWhpHWD+GdQ=; b=bgtvUGqnrNhsuQh59faI0kjjZ2FBD+TE/IQhlVEPy58TxnlY4EgI6X+ZV72ZK36cKu Z2qqeWXD9rpqd2ES4klUfsmrLVsk9YL27b4nxs5241X2SAnhMl9Xne+NphuuhS8gqVvA U2FHF7iAKOAUCek1WkeoKQ4ORNG7l+PVPhyJOlLbPDg15B1Qf8eOn704huiaWrRE17D6 8CAy7y7lNrjyIwMSOsfZIIHjUOm7y79H2/LZv76sMg9zRdNE7twLZv6bMgmsr6+MB5w8 emFDah0bMU8j3KVX5WkIO82xlfk8vzSYM4NiOgKexvb03d65vFMTOz+wr+9Bszl/gZh0 4ZkA== X-Gm-Message-State: AC+VfDz8w5St5XYZdY4LfBSFytqUOB7qc41iIyCBy68MszxzsQ9oAooS x5uvesD5Un4xsZzHYet22Vu5huZxPEM= X-Google-Smtp-Source: ACHHUZ5hrjXC+U2sotLW8dthLu1sP9pYLxQGknSkwRzyNDNtxHzaxYlrZSAJBNpsMupjnOG5kIqlzQ== X-Received: by 2002:aca:2405:0:b0:39a:58b3:4ad8 with SMTP id n5-20020aca2405000000b0039a58b34ad8mr1482317oic.38.1685692219519; Fri, 02 Jun 2023 00:50:19 -0700 (PDT) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id iw4-20020a170903044400b001aae64e9b36sm667630plb.114.2023.06.02.00.50.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Jun 2023 00:50:19 -0700 (PDT) In-Reply-To: <835y87elec.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.600.7) Received-SPF: pass client-ip=2001:4860:4864:20::2d; envelope-from=casouri@gmail.com; helo=mail-oa1-x2d.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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:306547 Archived-At: > On May 31, 2023, at 11:39 PM, Eli Zaretskii wrote: >=20 >> From: Stefan Monnier >> Cc: Eli Zaretskii , emacs-devel@gnu.org, >> mickey@masteringemacs.org, theo@thornhill.no, dgutov@yandex.ru >> Date: Thu, 01 Jun 2023 00:06:54 -0400 >>=20 >>> Keep in mind that when people try out tree-sitter modes, they are = unlikely >>> to just throw away their config for the old mode; also since = tree-sitter and >>> grammars aren=E2=80=99t the easiest to install, people working on = multiple machines >>> probably want both tree-sitter and no-tree-sitter modes configured = and ready >>> to go. So I think we=E2=80=99ll see a lot of people having config = for both modes (me >>> included). >>=20 >> Good point. >=20 > It's a good point, indeed, but with some mode pairs is very hard > (read: impossible) to achieve. A notable example is c-mode and > c-ts-mode: the former has a lot of mode-specific commands and features > that cannot be used with the latter, because there's no equivalent > infrastructure that supports the same interfaces, and sometimes > because the feature makes no sense in a TS-based mode. We try very > hard to use the same key bindings and variable names where it does > make sense, but the group of features where that is possible is very > small. For example, all the enormous set of features we have in CC > mode around indentation and its customization cannot be "ported" to > c-ts-mode and c++-ts-mode, because the latter is built on completely > different analysis of the text. Another example is the ad-hoc support > for some frequently-use macro names that CC mode has. I fully agree. Note thought that I wasn=E2=80=99t saying ts and non-ts = modes should accept the same set of configs. I know all-too-well = that=E2=80=99s impossible (for the majority of modes). I was saying that = sometimes there are configs that can be shared (enabling = electric-quote-local-mode, for example), and it would be nice to put = them in a single hook rather than duplicating the code in two hooks.=20 Yuan