From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron Newsgroups: gmane.emacs.devel Subject: Re: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846) Date: Wed, 07 Aug 2024 10:33:23 +0200 Message-ID: References: <171558357066.26019.9766615061719600757@vcs2.savannah.gnu.org> <86v83hwxjs.fsf@mail.linkov.net> <86ikzhq6ja.fsf@mail.linkov.net> <86o798x5hz.fsf@gnu.org> <86bk572e6a.fsf@mail.linkov.net> <861q62pb8y.fsf@mail.linkov.net> <864jayjd8u.fsf@gnu.org> <86le49ymsl.fsf@mail.linkov.net> <86msoo4cf3.fsf@mail.linkov.net> <865xv9ugjx.fsf@mail.linkov.net> <867cffdsp8.fsf@mail.linkov.net> <86ttgs78eu.fsf@mail.linkov.net> <86msmj9adm.fsf@mail.linkov.net> <864j7wkf66.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17373"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Stefan Monnier , Eli Zaretskii , emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 07 10:34:35 2024 Return-path: Envelope-to: ged-emacs-devel@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 1sbc7t-0004Kv-WB for ged-emacs-devel@m.gmane-mx.org; Wed, 07 Aug 2024 10:34:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbc6w-0006PO-FC; Wed, 07 Aug 2024 04:33:34 -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 1sbc6u-0006PE-R8 for emacs-devel@gnu.org; Wed, 07 Aug 2024 04:33:32 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbc6t-0000Sk-3p; Wed, 07 Aug 2024 04:33:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1723019606; bh=Hcroqv+JxwQ49ofcDAaHdUP+sBZ1m3yxs8vILeaUZn4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=e7aFVBuv71b/dwqaSmRNlpAuqHuC72lvP1me+d5TizxVfSEK63aS3S7/vTsBjKaB8 sK7k6QenPnAAG2YhGLrFy9rdZeibQmIdr6H7zFK6FMUyN6KhyXedNQaanBpUoByXJC TiNmSk5YOZcWV9HjgRQQ9r8Y/PUlftYv7fR0nNr4NVJdOZ9mPgCQOxjRSazlG3c39j tKBl+htvWTawE2OzM3goDtR9u4ZkqoCNWwTMt5bvrMBcSNNROmQ7kVMGZXJsxBVBQ4 xCPjU3VftFxTRCPJx64sEdFBTIAf0ZQ9X750YgoZclDxWYTuxdYVVX8uvw0BT7fP4Z 8NZn+YXdpbd/Q== In-Reply-To: <864j7wkf66.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 07 Aug 2024 09:51:53 +0300") Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; helo=eshelyaron.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:322482 Archived-At: Hi Juri, Juri Linkov 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