From: Juri Linkov <juri@linkov.net>
To: Troy Brown <brownts@troybrown.dev>
Cc: 73117@debbugs.gnu.org
Subject: bug#73117: 30.0.90; Imenu missing entries when flattening by group
Date: Sun, 08 Sep 2024 09:53:16 +0300 [thread overview]
Message-ID: <86v7z6skkj.fsf@mail.linkov.net> (raw)
In-Reply-To: <CABvCZ41tbNXHbFbmMitVt5Pc=mZTLBLfMvBQCJ=Ok7GgQVgJiQ@mail.gmail.com> (Troy Brown's message of "Sat, 7 Sep 2024 21:41:43 -0400")
> 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-<down>" 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-<down>" 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-<down>` 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 `<down>`
with `minibuffer-visible-completions`.
next prev parent reply other threads:[~2024-09-08 6:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-08 1:41 bug#73117: 30.0.90; Imenu missing entries when flattening by group Troy Brown
2024-09-08 6:53 ` Juri Linkov [this message]
2024-09-08 14:19 ` Troy Brown
2024-09-08 16:35 ` Juri Linkov
2024-09-08 17:31 ` Troy Brown
2024-09-20 6:58 ` Juri Linkov
2024-09-28 9:20 ` Eli Zaretskii
2024-09-08 18:28 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-08 19:25 ` Troy Brown
2024-09-15 15:58 ` Troy Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86v7z6skkj.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=73117@debbugs.gnu.org \
--cc=brownts@troybrown.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).