From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846) Date: Wed, 07 Aug 2024 09:51:53 +0300 Organization: LINKOV.NET Message-ID: <864j7wkf66.fsf@mail.linkov.net> References: <171558357066.26019.9766615061719600757@vcs2.savannah.gnu.org> <20240513065931.0D83AC12C31@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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40565"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: Stefan Monnier , Eli Zaretskii , emacs-devel@gnu.org To: Eshel Yaron Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 07 09:00:38 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 1sbaez-000AQU-Fx for ged-emacs-devel@m.gmane-mx.org; Wed, 07 Aug 2024 09:00:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbae9-0001Cf-EG; Wed, 07 Aug 2024 02:59:45 -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 1sbae7-0001C0-En for emacs-devel@gnu.org; Wed, 07 Aug 2024 02:59:43 -0400 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbae5-00041a-Bs; Wed, 07 Aug 2024 02:59:43 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id C15881BF203; Wed, 7 Aug 2024 06:59:22 +0000 (UTC) In-Reply-To: (Eshel Yaron's message of "Tue, 16 Jul 2024 08:57:08 +0200") X-GND-Sasl: juri@linkov.net Received-SPF: pass client-ip=217.70.183.201; envelope-from=juri@linkov.net; helo=relay8-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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:322480 Archived-At: > 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.) >> 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)))