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: My usage of imenu is broken. Date: Tue, 28 May 2024 17:55:28 -0400 Message-ID: References: <86r0dmtbk2.fsf@gnu.org> 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="2736"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 28 23:56:08 2024 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 1sC4ng-0000Tx-4d for ged-emacs-devel@m.gmane-mx.org; Tue, 28 May 2024 23:56:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sC4n8-000811-MY; Tue, 28 May 2024 17:55:34 -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 1sC4n6-00080b-UJ for emacs-devel@gnu.org; Tue, 28 May 2024 17:55:33 -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 1sC4n5-0006YT-1n; Tue, 28 May 2024 17:55:32 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 80030100048; Tue, 28 May 2024 17:55:29 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1716933328; bh=YnPhtk2eRuuGxvELxtTZWZAvT3UND22r6d3bhbYLGns=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=hW8UbqdG+2mxVFhXLHT/LMxqeT5I21+0dV3sI1AQcxLYb1OEcf+IDgaOMD352NirI iDmsW/akYC3SAb/fQ71qJZTWlZrJ0xts9CrDig0pSZatoyngQACMtU8tRsGWeLVcwo d+DE4OdbVdkbTtuCSwd7U9f23smFzDSo3RFN2nM9VJ5gG/FSCVBGQnJr+tGo116aHT q3NSE2jdlCteZPTOZ/3K6VdFghOPy3Tp2LryWmb7R2TUsY8zzellYFuSVWgNOXZj3P yVGP/ALIIHVMnIhqzHxE6ujWg8cpjdv8EfdoMS3dvLCjxYQQYolUXY+rM2nwad7bIQ utxmlj4YzjCtw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 86521100035; Tue, 28 May 2024 17:55:28 -0400 (EDT) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 76A61120185; Tue, 28 May 2024 17:55:28 -0400 (EDT) In-Reply-To: (Alan Mackenzie's message of "Tue, 28 May 2024 13:57:46 +0000") 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, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-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:319660 Archived-At: > I now understand what's happening. Stefan M committed a patch some > while ago, the effect of which is to force users who've set up their > auto-mode-alist for CC Mode to use c-ts-mode, etc., instead. That's one way to see it. =F0=9F=99=82 > Yesterday, I'd reverted src/eval.c (which normally gets loaded via > desktop), and Stefan's patch converted it to c-ts-mode without me being > aware of this. The way I see it, the problem is in `c-ts-mode.el` where merely loading the file changes the default mode to use for C files to `c-ts-mode` (tho only in the current session, thank god). My patch(es) only change(s) the mechanism used for that. I think this is a misfeature of `c-ts-mode.el`, but this was the result of a long discussion and I don't think we want to revisit that yet. > I don't understand what major-mode-remap and major-mode-remap-defaults > are for. They are designed to allow specifying which C mode Emacs should use (not only for C, obviously). In the past, `auto-mode-alist` way used for that, but that did not account for cases where the major mode is not specified via the file name, but instead via `-*- mode -*-`, or via `interpreter-mode-alist`, or via ... Also it encouraged `c-ts-mode.el` (and friends) duplicating the regexps used to specify "this is probably a C file", often doing it slightly differently from the other major mode. Instead, conceptually `auto-mode-alist` should now be used to specify the type of content (tho represented not as something like a MIME type but as a symbol that (usually) denotes a major mode), and then `major-mode-remap` is used to decide which major mode to use for that file type. > They would appear to be duplicating and confusing the mechanism > of auto-mode-alist, and seem unnecessary. It seems clear they are too > difficult to use. Clear as mud, indeed. Stefan