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.devel Subject: Re: My usage of imenu is broken. Date: Tue, 28 May 2024 13:57:46 +0000 Message-ID: References: <86r0dmtbk2.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="27978"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 28 15:58:45 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 1sBxLh-00074m-9E for ged-emacs-devel@m.gmane-mx.org; Tue, 28 May 2024 15:58:45 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBxKv-0006PI-2s; Tue, 28 May 2024 09:57:57 -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 1sBxKt-0006P5-D7 for emacs-devel@gnu.org; Tue, 28 May 2024 09:57:55 -0400 Original-Received: from mail.muc.de ([193.149.48.3]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBxKr-00058A-9Q for emacs-devel@gnu.org; Tue, 28 May 2024 09:57:55 -0400 Original-Received: (qmail 71896 invoked by uid 3782); 28 May 2024 15:57:50 +0200 Original-Received: from muc.de (p4fe15d2d.dip0.t-ipconnect.de [79.225.93.45]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 28 May 2024 15:57:50 +0200 Original-Received: (qmail 8959 invoked by uid 1000); 28 May 2024 13:57:46 -0000 Content-Disposition: inline In-Reply-To: <86r0dmtbk2.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.3; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-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:319649 Archived-At: Hello, Eli. On Tue, May 28, 2024 at 14:34:21 +0300, Eli Zaretskii wrote: > > Date: Tue, 28 May 2024 10:53:18 +0000 > > From: Alan Mackenzie > > Hello, Emacs. > > imenu no longer works for me. The imenu page in the Emacs manual says > > the command [imenu] always displays the whole list of valid names. > > This is not true. When I type C-c i (my binding for imenu) I see no > > such list. > AFAIK, this never worked literally as the manual says. I went as far > back as Emacs 23, and I don't see it. > > When I additionally type TAB I still see no such list. > I do see the list after TAB. So I guess the devil is in the details > (which file you were visiting, under what major mode, etc.) -- details > you haven't provided... > > All I see is *Rescan*, Function, and Variable. I think the manual > > should be fixed. > Let's first understand why it doesn't work for you as it does for me. 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. It is in a subroutine of normal-mode where this subterfuge occurs. 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. So my problem was being in c-ts-mode, for which all these things I don't like about imenu are apparently normal. It's one more reason for me to carry on using CC Mode. I'd wrongly jumped to the conclusion that what I was seeing was due to recent changes in imenu.el, so apologies to yourself and those who amended imenu.el. > > The manual talks about "flatten"ing without explaining what this means. > > The NEWS item doesn't explain it either. I think this should be fixed. > Sadly, it is quite pointless to complain about deficiencies of > documentation in most cases, because no one which is in the position > to fix that is listening or can be bothered! :-( Yes. Maybe I should fix it myself. Substandard documentation was one of the things which led to the fall of XEmacs. [ .... ] > > How do I get the old behaviour back, please? Why doesn't the NEWS item > > say how to get back the old behaviour? > Old behavior in what Emacs version, please? (In fact, you don't even > say in which version the above misbehavior happened to you, which I > find unexpected from you.) Sorry, I was in master, but not in emacs -Q. [ .... ] The bug "fix" and its patch which caused all this trouble were: Bug#69191 New var `major-mode-remap-defaults`, for packages. commit 2b5d43081a30f816dd38a16c7b5bfbad712a779b Author: Stefan Monnier Date: Sun Mar 3 23:08:16 2024 -0500 (major-mode-remap(-defaults)): New var and function (bug#69191) I don't understand what major-mode-remap and major-mode-remap-defaults are for. 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. I would favour reverting that patch, and thus restore the preference of users for CC Mode. Stefan, your comments, please. -- Alan Mackenzie (Nuremberg, Germany).