From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#73117: 30.0.90; Imenu missing entries when flattening by group Date: Sun, 08 Sep 2024 09:53:16 +0300 Organization: LINKOV.NET Message-ID: <86v7z6skkj.fsf@mail.linkov.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2904"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: 73117@debbugs.gnu.org To: Troy Brown Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 08 08:58:38 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 1snBsc-0000Zp-3b for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Sep 2024 08:58:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1snBs4-0004kU-GM; Sun, 08 Sep 2024 02:58:04 -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 1snBs1-0004jk-CC for bug-gnu-emacs@gnu.org; Sun, 08 Sep 2024 02:58:01 -0400 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 1snBs1-00073s-2v for bug-gnu-emacs@gnu.org; Sun, 08 Sep 2024 02:58:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=aoNfNyqtmCR8/jqgcsKSb4Aku4ARLAy5bZARVkdgL3g=; b=DDfHbbV6asxos7MAExsbY6PL6ksS+/nEM9+HA6v1fkgqnJrow12Rnn1fyyms0ZgM/kZcm2YQ845NWk2gJZIYnqhagqGo8cDkchE9S4FDbqr9fA93PIfFB5vTo+9Nnu9i7Im26cJXj+0+5oQ92frXX0RGm8DEz+Y+5m/IuZjun5F8dzG/hGz94ZRwRuQcuyPCTGCSOD1wb4tAsUBivn1qqflafS3ASNxbWc8UGRe8054UyR7MhogeQ5q/B4PtnaTrQBSiDc2194J2icJji/QWogLDK21MXZT079kOTKVNk5H0Ls6yiplnqMepsa/zm5vQyHMgj3BAsDkS6BMOZtqffw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1snBs2-0001Nl-S9 for bug-gnu-emacs@gnu.org; Sun, 08 Sep 2024 02:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Sep 2024 06:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73117 X-GNU-PR-Package: emacs Original-Received: via spool by 73117-submit@debbugs.gnu.org id=B73117.17257786375235 (code B ref 73117); Sun, 08 Sep 2024 06:58:02 +0000 Original-Received: (at 73117) by debbugs.gnu.org; 8 Sep 2024 06:57:17 +0000 Original-Received: from localhost ([127.0.0.1]:57904 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snBrJ-0001MN-0W for submit@debbugs.gnu.org; Sun, 08 Sep 2024 02:57:17 -0400 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:33451) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snBrH-0001Lx-Fi for 73117@debbugs.gnu.org; Sun, 08 Sep 2024 02:57:16 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 72EF8FF802; Sun, 8 Sep 2024 06:57:05 +0000 (UTC) In-Reply-To: (Troy Brown's message of "Sat, 7 Sep 2024 21:41:43 -0400") X-GND-Sasl: juri@linkov.net 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:291427 Archived-At: > This issue appears to be similar to the issue reported in 70846, but > this is specifically regarding when Imenu is configured to flatten > into "groups" (as opposed to "annotation" as was reported there). > When "imenu-flatten" is set to "group", I see an issue where nested > entries, with the same name but belonging to different parents, aren't > all displayed. > > I've included an example below (based on the example menu > configuration described in 70846). This example cycles through > flattening based on "index", "group" and "annotation" with the example > menu configuration. > > For "prefix" and "annotation" configurations, it appears to work > correctly, as pressing "M-" when the menu prompt is displayed, I > can see both entries identified in the "*Completions*" buffer. > > However, when I do this with "imenu-flatten" set to "group" and press > "M-" to display the completions window, the window indicates "2 > possible completions" but only one is actually displayed and > selectable (i.e., the one under "Bar"). The menu entry "Foo" under > "Baz" is not displayed at all and it appears there is no way to select > it. > > ``` > ;; begin > (progn > (require 'imenu) > (dolist (flatten '(prefix group annotation)) > (setq imenu-flatten flatten) > > (imenu-choose-buffer-index (format "(%s) Index item: " flatten) > `(("Bar" . (("Foo" . ,(point-min-marker)))) > ("Baz" . (("Foo" . ,(point-max-marker)))))))) > ;; end > ``` Sorry for leaving out of documentation an unapparent mention of `completions-group`. We are discussing this currently at https://mail.gnu.org/archive/html/emacs-devel/2024-08/msg00241.html So a prerequisite would be to use `(setopt completions-group t)`. But currently this should be mentioned in the docstring. Also in the same discussion we came to conclusion that `M-` can't be used to select imenu items for `annotation` and `group`. So this limitation was documented recently in the docstring of `imenu-flatten`: @@ -158,6 +158,9 @@ imenu-flatten with a suffix that is the section name to which it belongs. If the value is `group', split completion candidates into groups according to the sections. +Since the values `annotation' and `group' rely on text properties, +you can use them only by selecting candidates from the completions +buffer, not by typing in the minibuffer. Otherwise, `group` should work nicely when using `` with `minibuffer-visible-completions`.