unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eshel Yaron <me@eshelyaron.com>
To: Juri Linkov <juri@linkov.net>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
	 Eli Zaretskii <eliz@gnu.org>,
	 emacs-devel@gnu.org
Subject: Re: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846)
Date: Wed, 07 Aug 2024 10:33:23 +0200	[thread overview]
Message-ID: <m14j7w20mk.fsf@dazzs-mbp.home> (raw)
In-Reply-To: <864j7wkf66.fsf@mail.linkov.net> (Juri Linkov's message of "Wed,  07 Aug 2024 09:51:53 +0300")

Hi Juri,

Juri Linkov <juri@linkov.net> writes:

>> I forgot to mention that this also affects using previous minibuffer
>> inputs with M-p: the text properties aren't recorded in the history
>> list, so you get an ambiguous input that doesn't always take you to
>> where you went when you previously used that input.
>
> Do you mean that text properties are not saved between sessions?
> Because in the same session text properties are preserved in the history.
> (This assumes that you select candidates by completion selection UI.)

Hmm right, I probably didn't select the candidate from the completions
UI when I tested this scenario.

>>> Unfortunately, that'd be a step back.  Maybe at least we could document
>>> limitations that annotations work only by selection.
>>
>> Indeed my suggestion was to take a step back of sorts.  If it's too late
>> for that, I agree it's a good idea to document the known issues.
>
> Ok, so here is a patch for emacs-30:
>
> diff --git a/lisp/imenu.el b/lisp/imenu.el
> index 708a39a0f71..ae030e0104a 100644
> --- a/lisp/imenu.el
> +++ b/lisp/imenu.el
> @@ -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.
>  Any other value is treated as `prefix'.
>
>>> It can't be boolean, because a more reliable replacement for annotations
>>> would be appending the suffix, i.e. by the new value 'suffix'.
>>
>> That makes sense.
>
> Ok, here is the implementation for emacs-30 where documentation could be
> added later to not cause merge conflicts with the documentation changes above:
>
> diff --git a/lisp/imenu.el b/lisp/imenu.el
> index 708a39a0f71..31937d3f333 100644
> --- a/lisp/imenu.el
> +++ b/lisp/imenu.el
> @@ -827,6 +830,9 @@ imenu--flatten-index-alist
>                         ('group (propertize name
>                                             'imenu-section (or prefix "*")
>                                             'imenu-choice item))
> +                       ('suffix (if prefix
> +				    (concat name imenu-level-separator prefix)
> +			          name))
>                         (_ new-prefix))
>  		     pos)))

Both of these changes look like nice improvements to me :)


Cheers,

Eshel



  reply	other threads:[~2024-08-07  8:33 UTC|newest]

Thread overview: 36+ 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   ` master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846) Eshel Yaron
2024-05-13 16:30     ` 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-07-14  6:28                               ` Eshel Yaron
2024-07-14  6:53                                 ` Juri Linkov
2024-07-14 10:55                                   ` Eshel Yaron
2024-07-14 17:00                                     ` Juri Linkov
2024-07-16  6:57                                       ` Eshel Yaron
2024-08-07  6:51                                         ` Juri Linkov
2024-08-07  8:33                                           ` Eshel Yaron [this message]
2024-08-07 16:46                                             ` Juri Linkov
2024-08-09  6:59                                               ` Juri Linkov
2024-08-09  7:11                                                 ` Eli Zaretskii
2024-08-09 16:10                                                   ` Juri Linkov
2024-08-09 17:43                                                     ` Eli Zaretskii
2024-08-07  6:56                                         ` Completions group metadata [was: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846)] Juri Linkov
2024-08-09 16:16                                           ` Completions group metadata [ Juri Linkov
2024-08-14  1:41                                       ` master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846) Stefan Monnier
2024-08-20 17:51                                         ` 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

  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=m14j7w20mk.fsf@dazzs-mbp.home \
    --to=me@eshelyaron.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=monnier@iro.umontreal.ca \
    /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).