From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#69191: 30.0.50; New var `major-mode-remap-defaults`, for packages Date: Sun, 03 Mar 2024 23:25:27 -0500 Message-ID: References: <875xyiext7.fsf@epfl.ch> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15380"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 69191@debbugs.gnu.org To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 04 05:27:11 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rgzux-0003lU-OQ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Mar 2024 05:27:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgzuO-0001E0-TB; Sun, 03 Mar 2024 23:26:36 -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 1rgzuN-0001D5-45 for bug-gnu-emacs@gnu.org; Sun, 03 Mar 2024 23:26:35 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgzuM-0004XM-SV for bug-gnu-emacs@gnu.org; Sun, 03 Mar 2024 23:26:34 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rgzuq-0005OV-79 for bug-gnu-emacs@gnu.org; Sun, 03 Mar 2024 23:27:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Mar 2024 04:27:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69191 X-GNU-PR-Package: emacs Original-Received: via spool by 69191-submit@debbugs.gnu.org id=B69191.170952637120573 (code B ref 69191); Mon, 04 Mar 2024 04:27:04 +0000 Original-Received: (at 69191) by debbugs.gnu.org; 4 Mar 2024 04:26:11 +0000 Original-Received: from localhost ([127.0.0.1]:41528 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rgztz-0005Ll-B5 for submit@debbugs.gnu.org; Sun, 03 Mar 2024 23:26:11 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:12142) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rgztx-0005LT-D4 for 69191@debbugs.gnu.org; Sun, 03 Mar 2024 23:26:10 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 88893808AF; Sun, 3 Mar 2024 23:25:33 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1709526328; bh=FVz0L+buMf/A89+iohNiZeOyQgW8y94WLQgJNv9QwKQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=COdjUS0IZml27csXCOsXlsoWloK+HvSrLT8g2u1kyneIn5p7V4qEEdxCDvfYt5+fy 0frno27ylFEzq8aMB12Fi3T5hJOCIQBGoU61hLEmInlEN/4vdh5gtHK78lqZCU95vv WYO2fY2v3Oe65Krq4bD7tcCHAzhqGyE22ab+xUMq6+aDRIFfM3xnnDHgKW/5YL6zLq USsl3Q/oBNVYllWOjEFiXPvyR/3CZX+wjIjlHs8HsiUcAt2QhcaVo8ilYpnS7+rQRR 69w2WfB3bc6GGmVmsFIAYkFe81SdNFNnO3bJw077vHIxkLQCs9YrrRFxUcJ+CVVaHG ZuAe1BZCdEVYQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 4FC8B80946; Sun, 3 Mar 2024 23:25:28 -0500 (EST) Original-Received: from pastel (unknown [104.247.233.29]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 25C4E120866; Sun, 3 Mar 2024 23:25:28 -0500 (EST) In-Reply-To: <875xyiext7.fsf@epfl.ch> (Basil L. Contovounesios's message of "Wed, 21 Feb 2024 14:44:52 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280977 Archived-At: >> There are some FIXMEs that one might want to address, most importantly >> whether we should use an indirection through `major-mode-remap-defaults` >> for all TS modes or only for those for which we provide a non-TS mode. > > My gut says: we shouldn't add out-of-tree modes (e.g. go-mode) to > auto-mode-alist (they should and already do that themselves); and so > long as TS modes are viewed as an optional alternative, then they should > be responsible for setting up major-mode-remap-defaults (so it should be > a no-op if they remap from an out-of-tree mode that is not installed). I like the idea of using `go-mode` as the canonical mode, even if we don't provide it. But I left this part unchanged for now. >> + (let ((mode >> + (if (save-excursion >> + (save-restriction >> + (save-match-data ; Why `save-match-data'? >> + (widen) >> + (goto-char (point-min)) >> + (re-search-forward c-ts-mode--c-or-c++-regexp nil t)))) >> + 'c++-ts-mode) >> + 'c-ts-mode)) > I'm excited for this new let-syntax to catch on, but maybe as a separate > feature request. You think you're funny. eh? >> -;;;###autoload (defalias 'TeX-mode #'tex-mode) >> -;;;###autoload (defalias 'plain-TeX-mode #'plain-tex-mode) >> -;;;###autoload (defalias 'LaTeX-mode #'latex-mode) >> +;;;###autoload (add-to-list 'major-mode-remap-defaults '(TeX-mode . tex-mode)) >> +;;;###autoload (add-to-list 'major-mode-remap-defaults '(plain-TeX-mode . plain-tex-mode)) >> +;;;###autoload (add-to-list 'major-mode-remap-defaults '(LaTeX-mode . latex-mode)) > > Can we really afford to lose the aliases in loaddefs.el? > There are at least a few in-tree uses of the AUCTeX names. Oops, indeed. Hmm... too bad, it means we still have to keep those aliases a while longer. Stefan