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: Mon, 13 May 2024 19:30:59 +0300 Organization: LINKOV.NET Message-ID: <86v83hwxjs.fsf@mail.linkov.net> References: <171558357066.26019.9766615061719600757@vcs2.savannah.gnu.org> <20240513065931.0D83AC12C31@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21674"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Eshel Yaron Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 13 18:33:21 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 1s6Yc4-0005Sl-Qf for ged-emacs-devel@m.gmane-mx.org; Mon, 13 May 2024 18:33:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6Yav-000335-Qk; Mon, 13 May 2024 12:32:10 -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 1s6Yak-00032J-2B for emacs-devel@gnu.org; Mon, 13 May 2024 12:31:59 -0400 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s6Yaf-0001U6-Bo for emacs-devel@gnu.org; Mon, 13 May 2024 12:31:55 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id A7AB0FF805; Mon, 13 May 2024 16:31:48 +0000 (UTC) In-Reply-To: (Eshel Yaron's message of "Mon, 13 May 2024 11:22:32 +0200") X-GND-Sasl: juri@linkov.net Received-SPF: pass client-ip=217.70.183.199; envelope-from=juri@linkov.net; helo=relay9-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_H2=-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:319204 Archived-At: > 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: > > * Bar > ** Foo > * Baz > ** Foo > > What do you think about disambiguating just the duplicates in such cases > by adding some part of the prefix to the completion candidate string? I'm aware of this limitation, I tested it on function/variable ambiguity. One way to disambiguate them is to use text properties on the completion candidate strings. But unfortunately read-from-minibuffer doesn't obey a non-nil value of minibuffer-allow-text-properties, because choose-completion unconditionally discards all properties by substring-no-properties. Maybe choose-completion should use substring instead of substring-no-properties when minibuffer-allow-text-properties is non-nil?