From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Troy Brown Newsgroups: gmane.emacs.bugs Subject: bug#73117: 30.0.90; Imenu missing entries when flattening by group Date: Sun, 8 Sep 2024 10:19:26 -0400 Message-ID: References: <86v7z6skkj.fsf@mail.linkov.net> 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="13138"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73117@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 08 16:20:29 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 1snImC-00038k-GA for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Sep 2024 16:20:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1snIln-0007m2-Nj; Sun, 08 Sep 2024 10:20:03 -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 1snIlk-0007ku-T7 for bug-gnu-emacs@gnu.org; Sun, 08 Sep 2024 10:20:00 -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 1snIlk-0006Uy-3d for bug-gnu-emacs@gnu.org; Sun, 08 Sep 2024 10:20:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=K4es7STQlU1oGOblaHFGhW8Dsc/7Z+a4MuRoXueU9w0=; b=f2eYb+6BV6v157I78I1TyXmbK4lGeohIh+1LnACrtc/LLf3BGqQeZwQsN/PzB6GSzWiN8F0NVFa8ZIj2oAHMggnF5t6AKmkwvcSu2+ZTDTPpNxQFAn319V/DFZmuOw/kFxYChrl6uHoSwOQuQmsbJuw9fUP9wxmvQyh2aKU7ogDbdYhwRsyN9SGMxH97fF20JkBxoZYH6ITwvB6xROT2KhYjFhovnb2XGeaRuRpMcm7y8o07PWaMTl2UmMg5aOPJh7sycO1/K1tYkvRvPlZtMFgS6fMlmY7SO6eKu2Kbmy87l39l5h7B/HgCw1R28pRfntEvOJLncZ87YsIW3zD+mQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1snIll-0007f7-W6 for bug-gnu-emacs@gnu.org; Sun, 08 Sep 2024 10:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Troy Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Sep 2024 14:20:01 +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.172580519029425 (code B ref 73117); Sun, 08 Sep 2024 14:20:01 +0000 Original-Received: (at 73117) by debbugs.gnu.org; 8 Sep 2024 14:19:50 +0000 Original-Received: from localhost ([127.0.0.1]:59790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snIlZ-0007eX-Gs for submit@debbugs.gnu.org; Sun, 08 Sep 2024 10:19:49 -0400 Original-Received: from mail-lj1-f178.google.com ([209.85.208.178]:55407) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snIlX-0007eK-R8 for 73117@debbugs.gnu.org; Sun, 08 Sep 2024 10:19:48 -0400 Original-Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2f74e468baeso39829851fa.2 for <73117@debbugs.gnu.org>; Sun, 08 Sep 2024 07:19:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725805179; x=1726409979; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K4es7STQlU1oGOblaHFGhW8Dsc/7Z+a4MuRoXueU9w0=; b=h3EHbi0nbskQUyrn0yOdeFO9BVxjTV8A5gzMrHDHFpOftHmqMhKIK7+d5bOuGcpjfL +tz47RrGwO9twbbgn8qgp8WQvQ5ChorYdP4zAaCSM1d0IIce62FqUqlLnW65lfzpIGXC v8vC2g0w6HBJi7WrzYb0c6D1P39TzoezygVUrYP5NDkI4Y+nrBWDU1dT88A99TYCw2XG vDqdRUdbXyexVay6Lwp8wOhAxddBXCVS9Xs39/IoOjUMZsw2NnB24Gm2EdCQi+HbhItp 22hgHci8u80x1k1XH8uD5uf8DFtyPgInoVjV8/DJG0MzuzPNOlYHefTtYStDKbypvUPh pmqw== X-Gm-Message-State: AOJu0Ywgt09t8reeXqk3iIpWDghqmOH2XCYCuy6xRPni+oUuYE7hi70A 4R99mptZkqx2alkKLowpeu8y/xyflyVj/ahEfnDswCzW0iajFr8wrXG7T9AwrRM= X-Google-Smtp-Source: AGHT+IGnZ8Vn81meu+/KdgIi6baHb5l3mDN6F9s/7PfB6jBWVytM6s5tgAqfgRZqFHM1f229SD36ug== X-Received: by 2002:a05:651c:19aa:b0:2ef:2472:300a with SMTP id 38308e7fff4ca-2f75b87f0cdmr34370701fa.2.1725805178098; Sun, 08 Sep 2024 07:19:38 -0700 (PDT) Original-Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com. [209.85.208.180]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2f75c009937sm4225151fa.67.2024.09.08.07.19.37 for <73117@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 Sep 2024 07:19:37 -0700 (PDT) Original-Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2f761cfa5e6so7803171fa.0 for <73117@debbugs.gnu.org>; Sun, 08 Sep 2024 07:19:37 -0700 (PDT) X-Received: by 2002:a2e:a99a:0:b0:2f6:4f17:aead with SMTP id 38308e7fff4ca-2f75b8b7d08mr35991931fa.21.1725805177550; Sun, 08 Sep 2024 07:19:37 -0700 (PDT) In-Reply-To: <86v7z6skkj.fsf@mail.linkov.net> X-Gmail-Original-Message-ID: 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:291452 Archived-At: On Sun, Sep 8, 2024 at 2:57=E2=80=AFAM Juri Linkov wrote: > > > ``` > > ;; 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`. Hi Juri, I did see the text in the diff above. I assumed that was indicating that you need to use the completions buffer to distinguish between the identically named items (although after re-reading it, maybe it affects the selection too). I was using M- to pop-up the completions buffer so that I could see those distinctions. Maybe using `(setopt completion-auto-help t)` and hitting TAB is a better method. Either way, I'm just trying to display the completions buffer. This does work for the "annotations" setting as I see both entries with the suffix annotation in the completions buffer. Maybe there is a different issue using M- for the selection, but my issue is that I can't get the completions buffer to even display all of the items. Just to be clear I'm running "emacs -Q" on the latest in the emacs-30 branch as of yesterday. I ran the code snippet I posted in the original email by running `eval-last-sexp` in the scratch buffer. I did try adding your suggested settings to the above code snippet, but they did not seem to improve anything with regards to what shows up in the completions buffer: ``` (setopt completions-group t) (setopt minibuffer-visible-completions t) ``` The following is what I see in the "*Completions*" buffer for all three settings of `imenu-flatten` (i.e., "prefix", "group" and "annotation"). Notice that the second output (which is the "group" setting) only shows a single entry, the one for Bar/Foo. The "Bar" group is displayed and the "Foo" entry under it is also displayed, but the "Baz" group is completely missing (even though it says "2 possible completions"). This is the issue I'm having. --8<---------------cut here---------------start------------->8--- Click or type RET on a completion to select it. Type , , , to move point between completions. 2 possible completions: Bar:Foo Baz:Foo --8<---------------cut here---------------end--------------->8--- --8<---------------cut here---------------start------------->8--- Click or type RET on a completion to select it. Type , , , to move point between completions. 2 possible completions: Bar Foo --8<---------------cut here---------------end--------------->8--- --8<---------------cut here---------------start------------->8--- Click or type RET on a completion to select it. Type , , , to move point between completions. 2 possible completions: Foo (Bar) Foo (Baz) --8<---------------cut here---------------end--------------->8---