From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Extending define-derived-mode Date: Mon, 05 Jun 2023 11:17:47 -0400 Message-ID: References: <20F07C52-6B39-4B24-8433-82E2226EADA6@gmail.com> <83zg5mf62s.fsf@gnu.org> <42DEA948-61CF-48CC-B27E-197E603CA57E@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="31841"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , emacs-devel , Mickey Petersen , Theodor Thornhill , dgutov@yandex.ru To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 05 17:18:47 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 1q6Byp-000867-8e for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Jun 2023 17:18:47 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q6By4-0001Ne-Qz; Mon, 05 Jun 2023 11:18:00 -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 1q6By3-0001NT-PG for emacs-devel@gnu.org; Mon, 05 Jun 2023 11:17:59 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q6Bxy-0003L5-76; Mon, 05 Jun 2023 11:17:59 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 68FCB8023E; Mon, 5 Jun 2023 11:17:51 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 285218080C; Mon, 5 Jun 2023 11:17:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1685978270; bh=DCu/aVZPYg0gSOBQ8JGbAsaVmtkvWNb2+7dxkysi5CE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=jcFhA77cgb/xbsy8MYl90pPrdzNRcA9UuGWf21Pq4YvbQLq0xpoiYF/o0Q2xskWzQ Xv8f4SNiPojHdEWJRQWgD36JDDSmTvpHnFs5idHCuXKjdLNRawJFo2f7x8423euj/y ZUkXFXIuHkJHiIELyP8RiPDT4yN0kEZ8dojR7/CLX7bvvCsW3YMTw6RrV2VhE0eww/ rvXcrSGV+wWPQYHt0sa3n8tXvYHVVna5h7JqngvDB31TNLFJ81WrNAiM6hAHWmaDfQ E+LXCLIZ1r/uf++r4cDZpYmQbv0TTybGOC4VOu2SAuGqssPcHIZMSvWxzjtxWqThN/ ev50IAS1QlWNQ== Original-Received: from alfajor (unknown [45.44.229.252]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C5D661204A1; Mon, 5 Jun 2023 11:17:49 -0400 (EDT) In-Reply-To: <42DEA948-61CF-48CC-B27E-197E603CA57E@gmail.com> (Yuan Fu's message of "Mon, 5 Jun 2023 00:39:41 -0700") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=ham 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:306652 Archived-At: >> But IIUC you're suggesting that this hook would only exist "when someone >> defines a major mode with xxx-base-mode as parent", so it's >> dynamic/conditional. > IIUC you can add functions to a hook regardless whether it=E2=80=99s defi= ned > or not, so it should be fine? The question is not whether the variable is `boundp` or not but whether it's run or not. I think making it dynamic/conditional on the existence of some other major mode that refers to it will likely cause surprises. > BTW, I want to clarify one thing: how are we feeling about base modes? > Are they fine? Are they staying? Good question. To me they're halfway between The Right Thing and Overkill :-( Stefan