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.bugs Subject: bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Date: Sat, 16 Nov 2024 23:00:09 +0200 Message-ID: <86serqx5ba.fsf@gnu.org> References: <86v7wnh2bk.fsf@gnu.org> <86plmvf2mq.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9904"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, 74367@debbugs.gnu.org, stefankangas@gmail.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 16 22:01:26 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 1tCPv3-0002O6-QU for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Nov 2024 22:01:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tCPuj-0004vv-3a; Sat, 16 Nov 2024 16:01:05 -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 1tCPug-0004vR-Go for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 16:01:02 -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 1tCPug-0007Ic-7q for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 16:01:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=GZICIDxnxusdF54VAX8TTxna2t5RA+PSzA5FuN/JqX0=; b=QUbFjzfjEC//6W4ZUWwyWA4jTIEWjGOQedoDH7mbf0Qo92urKtLW2oXM25UDdYfYRyES0vOD0hZjxCL3Kg9BXoHL9bdxv8w8bkBeyCMYgVHX/A4/7Mq32cocy/NztJxbG+wdyNgOuhAxLJO2+EKLSIlqLdMUYnPWql3kY+ZriRQN8oOiYB4otnzE2a1ggmOkPn8DY4M+gb6KkFP57v1UVhwf/1662ndEtUeQTwVIe1PT7xzNNzWiJE26bGY4HdO/2oIeLfHv5lbb+wEB3iPwr8KImrrvMEKaEQUAfRPjhlcgZpHK0e5rHbqqSKaWF+NOJl2vCLk7OoonvVXB6kWN3g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tCPug-0007It-39 for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 16:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Nov 2024 21:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74367 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74367-submit@debbugs.gnu.org id=B74367.173179082228015 (code B ref 74367); Sat, 16 Nov 2024 21:01:02 +0000 Original-Received: (at 74367) by debbugs.gnu.org; 16 Nov 2024 21:00:22 +0000 Original-Received: from localhost ([127.0.0.1]:54983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCPu1-0007Hh-Hs for submit@debbugs.gnu.org; Sat, 16 Nov 2024 16:00:21 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCPtz-0007HE-Cn for 74367@debbugs.gnu.org; Sat, 16 Nov 2024 16:00:20 -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 1tCPtt-0007E3-VP; Sat, 16 Nov 2024 16:00:13 -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=GZICIDxnxusdF54VAX8TTxna2t5RA+PSzA5FuN/JqX0=; b=blpEHUqiZQvx agQSpKuEFQx5T6y/0/mIvcGYO3OAtzeCADvhkxZegOGax9EFHatCV6QjfXLM7VYyDbKlIs+C7Wmw7 HHqfX1bmm+6xjpogxA9C4YW9raL70NgwcoNpUmzXxFTlaW75+xmq5TnmSTxGI0umrl3zfgeXjp3gc e9r7aR/Qa9DNYHKNQ+eeOjwm4iSLkUBdz439b/1ySR0QFmgjGyhzG+CTD84zVtIEXoeI+zDs1sQed pM6cZTFDqKLb7zXH4hHRz1Zfj7Mll8OxiL5unMlmkQAMiv3D5aV76K79IYAfvhloEan2UHBETxp3A YNBnb3BRJCDVrjl4gXtJ8A==; In-Reply-To: (message from Stefan Monnier on Sat, 16 Nov 2024 15:26:31 -0500) 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:295495 Archived-At: > From: Stefan Monnier > Cc: stefankangas@gmail.com, 74367@debbugs.gnu.org, acm@muc.de > Date: Sat, 16 Nov 2024 15:26:31 -0500 > > >> I don't understand why you insist on suggesting such a "setting" since > >> it's unreliable now and probably even more so in the future. > > Because that's what users did in Emacs 29. I don't want us to make an > > impression it no longer works. > > In Emacs-29, it did work, because it modified `auto-mode-alist` and > CC-mode never modified it back. > > In `emacs-30`, it doesn't work reliably any more because loading > `cc-mode.el` after `c-ts-mode.el` causes the default mode to revert to > `c-mode`. Loading `cc-mode.el` happens when you do `C-h f c-mode RET`, > or when you load a file that requires it, e.g.: This will be better once we fix the major-mode-remap-defaults are handled by the modes involved in this. But yes, the effect of your introduction of major-mode-remap-defaults and the subsequent changes in cc-mode is that loading the mode works less reliably now. Which is why the advice to use major-mode-remap-alist should now be the first one. > lisp/cedet/semantic/bovine/c.el:(eval-when-compile (require 'cc-mode)) > lisp/generic-x.el:(require 'cc-mode) > lisp/org/ob-C.el:(require 'cc-mode) > lisp/org/ob-fortran.el:(require 'cc-mode) > lisp/progmodes/antlr-mode.el:(require 'cc-mode) > lisp/progmodes/cc-mode.el:;; (require 'cc-mode) > lisp/progmodes/cmacexp.el:(require 'cc-mode) > lisp/progmodes/csharp-mode.el:(require 'cc-mode) > lisp/progmodes/cwarn.el:(require 'cc-mode) > lisp/progmodes/hideif.el:(require 'cc-mode) > lisp/progmodes/js.el:(require 'cc-mode) See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74339#38 > Also we're discussing changing `c-ts-mode.el` so loading it doesn't have > that effect at all That's not the change I am discussing in bug#74339. > which means that there's a good chance it will work even less well > in the future. So to me it's clear that suggesting the use of > `require` or `load` to change the default C mode is doing a > disservice to our users. Noted.