all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eshel Yaron <me@eshelyaron.com>
To: emacs-devel@gnu.org
Cc: Juri Linkov <juri@linkov.net>
Subject: Re: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846)
Date: Mon, 13 May 2024 11:22:32 +0200	[thread overview]
Message-ID: <m1bk5adq1z.fsf@eshelyaron.com> (raw)
In-Reply-To: <20240513065931.0D83AC12C31@vcs2.savannah.gnu.org> (Juri Linkov's message of "Mon, 13 May 2024 02:59:30 -0400 (EDT)")

Hi Juri,

Juri Linkov <juri@jurta.org> writes:

> branch: master
> commit 431f8ff1e38ca4367637c6b9fbc25d13d6f760a7
> Author: Juri Linkov <juri@linkov.net>
> Commit: Juri Linkov <juri@linkov.net>
>
>     * lisp/imenu.el: Support more values for imenu-flatten (bug#70846)
>
>     (imenu-flatten): Change type boolean to choice
>     of more values for prefix/suffix section names.
>     (imenu--completion-buffer): Add :annotation-function if
>     'imenu-flatten' is 'annotation'.

This is a nice option to have, unfortunately it doesn't play well with
the limitations of completing-read --- if we have two or more tree
branches that end with the same leaf (string), imenu-flatten=annotation
produces the same completion candidate string for multiple imenu items,
and choosing any of them loses information about the prefix and always
jumps to the first one.

For example, setting imenu-flatten to annotation seems to make it
impossible to jump to the second "Foo" heading in an Org buffer with the
following contents:

--8<---------------cut here---------------start------------->8---
* Bar
** Foo
* Baz
** Foo
--8<---------------cut here---------------end--------------->8---

What do you think about disambiguating just the duplicates in such cases
by adding some part of the prefix to the completion candidate string?


Best,

Eshel



       reply	other threads:[~2024-05-13  9:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <171558357066.26019.9766615061719600757@vcs2.savannah.gnu.org>
     [not found] ` <20240513065931.0D83AC12C31@vcs2.savannah.gnu.org>
2024-05-13  9:22   ` Eshel Yaron [this message]
2024-05-13 16:30     ` master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846) Juri Linkov
2024-05-14  6:08       ` Juri Linkov
2024-05-14  6:38         ` Eli Zaretskii
2024-05-14 13:10           ` Stefan Monnier
2024-05-14 16:46             ` Juri Linkov
2024-05-14 20:58             ` Daniel Mendler via Emacs development discussions.
2024-05-14 23:26               ` FW: [External] : " Drew Adams
2024-05-15 16:51           ` Juri Linkov
2024-05-15 18:03             ` Eli Zaretskii
2024-05-15 18:30             ` Eshel Yaron
2024-05-16  6:08               ` Juri Linkov
2024-05-16  9:51                 ` Eli Zaretskii
2024-05-17  6:48                   ` Juri Linkov
2024-05-17 15:36                     ` Stefan Monnier
2024-05-17 16:43                       ` Juri Linkov
2024-05-18 15:12                         ` Stefan Monnier
2024-05-20  6:46                           ` Juri Linkov
2024-05-27 18:18                             ` Juri Linkov
2024-05-14 15:26         ` [External] : " Drew Adams

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1bk5adq1z.fsf@eshelyaron.com \
    --to=me@eshelyaron.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.