From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#74339: 30.0.92; CC Mode stomps C TS Mode Date: Thu, 14 Nov 2024 19:53:33 +0000 Message-ID: References: <868qtnfd2d.fsf@gnu.org> <86r07elwoh.fsf@gnu.org> <86h68al2qz.fsf@gnu.org> <867c95kaye.fsf@gnu.org> <861pzdk4aq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17999"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, monnier@iro.umontreal.ca, 74339@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 14 20:54:24 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 1tBfv4-0004Z3-Tv for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Nov 2024 20:54:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBfum-0004rL-Pn; Thu, 14 Nov 2024 14:54:04 -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 1tBful-0004qw-Go for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 14:54:03 -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 1tBfuk-0008R4-CP for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 14:54:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=From:In-Reply-To:MIME-Version:References:Date:To:Subject; bh=D/tNW05XTjowFgkmUm+J/3wuLz6+tK9F/kMkp2/zC6c=; b=R6zWzJ19xQ4bO8aoXOyHwwLpL5r1cH/cW+kJdB4dEqoQORCGqoP46HXLpKGR3kYFIlGDZt8u7jzWe+zvJr348khWQQ6MOROBAvUG8FMSZYYeTOSB3JXkpdCtTzxtmAjFpyvwJCIDyxnej6bTz3ztQkh8yK5y3DDINPIT8Al4ucfdbwX/AuKAkGYlArHToiVxYPkJ0OwbhG6y07cAAROurWGBQk01ck1sSSi5ZWjDkB00zfSXbZuquooE0y3gEcSNeUZ0Us1UpPLIlC7E4x95hHhi6Qxxeu25QBjm/13oFfOhBIo48LppiqbNMDVwfmdYPLRTrleT5h2xJsvuvjzgIQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tBfuk-0000QL-0f for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 14:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Nov 2024 19:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74339 X-GNU-PR-Package: emacs Original-Received: via spool by 74339-submit@debbugs.gnu.org id=B74339.17316140231590 (code B ref 74339); Thu, 14 Nov 2024 19:54:01 +0000 Original-Received: (at 74339) by debbugs.gnu.org; 14 Nov 2024 19:53:43 +0000 Original-Received: from localhost ([127.0.0.1]:47272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBfuR-0000PV-AC for submit@debbugs.gnu.org; Thu, 14 Nov 2024 14:53:43 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:15532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBfuO-0000PF-Oe for 74339@debbugs.gnu.org; Thu, 14 Nov 2024 14:53:41 -0500 Original-Received: (qmail 65772 invoked by uid 3782); 14 Nov 2024 20:53:34 +0100 Original-Received: from muc.de (pd953aec8.dip0.t-ipconnect.de [217.83.174.200]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 14 Nov 2024 20:53:33 +0100 Original-Received: (qmail 25996 invoked by uid 1000); 14 Nov 2024 19:53:33 -0000 Content-Disposition: inline In-Reply-To: <861pzdk4aq.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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:295363 Archived-At: Hello, Eli. On Thu, Nov 14, 2024 at 21:23:41 +0200, Eli Zaretskii wrote: > > Date: Thu, 14 Nov 2024 17:45:28 +0000 > > Cc: 74339@debbugs.gnu.org, monnier@iro.umontreal.ca, acm@muc.de > > From: Alan Mackenzie > > On Thu, Nov 14, 2024 at 18:59:53 +0200, Eli Zaretskii wrote: > > > > Date: Thu, 14 Nov 2024 16:20:37 +0000 > > > > Cc: 74339@debbugs.gnu.org, monnier@iro.umontreal.ca, acm@muc.de > > > > From: Alan Mackenzie > > [ .... ] > > > > OK. It would seem there is then no need to put entries for > > > > c-mode/c-ts-mode into major-mode-remap-defaults. I don't think this > > > > solution is optimal, though. Perhaps we can come up with something > > > > better for Emacs 31. But let's just go with this "last loaded wins" > > > > strategem for Emacs 30. > > > OK, thanks. So I guess you will soon make that change in cc-mode.el > > > on the release branch? > > OK, I can manage that. > > I'll just outline a quick outline of what I see is to be done, so as to > > fix any misunderstandings before starting to hack the code: > > (i) CC Mode and c-ts-mode will both keep their autoload directives. > > (ii) On loading either library, all their auto-mode-alist entries will be > > refreshed. By "refresh" is meant they will be removed from > > auto-mode-alist (if present) and put back again at the top of that > > alist. > > (iii) Evaluating a mode command does not change auto-mode-alist (except > > when it causes an autoload). > > (iv) The manipulations of major-mode-remap-defaults by both libraries > > will be removed, since they are redundant. > > Any comments? > I prefer to make a simpler and more localized change, which only > manipulates major-mode-remap-defaults. I would not like to risk > changes like modifying auto-mode-alist, which might have other > unintended consequences, at least on the release branch. I thought we'd agreed to fix things by modifying auto-mode-alist. What we definitely agreed was that the old modes and the tree-sitter modes should be handled symmetrically, and that C Mode and friends wouldn't be disadvantaged. > Let's stay with major-mode-remap-defaults, since we already understand > well enough what the code does, and need just to tweak it in minor > ways. OK, then the following suggests itself. We have symbols like `current-c-mode' which would be remapped in major-mode-defaults-alist, and would be the cdrs of the entries in auto-mode-alist. We would remap `current-c-mode' each time cc-mode.el or c-ts-mode.el was loaded. This would avoid the need to modify auto-mode-alist at run time, and also avoid all the disadvantages of remapping `c-mode' itself. -- Alan Mackenzie (Nuremberg, Germany).