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: Mon, 13 May 2024 11:22:32 +0200 Message-ID: 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="16006"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Juri Linkov To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 13 11:23:23 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 1s6Rtz-0003uY-Jd for ged-emacs-devel@m.gmane-mx.org; Mon, 13 May 2024 11:23:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6RtI-0004AZ-N0; Mon, 13 May 2024 05:22:40 -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 1s6RtH-00049w-1j for emacs-devel@gnu.org; Mon, 13 May 2024 05:22:39 -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 1s6RtD-0004oX-OY for emacs-devel@gnu.org; Mon, 13 May 2024 05:22:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1715592154; bh=x+YJQHZzf37tlhXCkL2RWBETqfvR61MF5pCy/9WrxwM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=iIDHnpNdLGS0chOa0NZiuM57wWp3YN1Zzeg7JjM9SxbtmGGZQ30z2rgGxTA6OEK70 hoX9nsA9eFbGCgIflP10FNlHbYsWDfhe5DYxi0ureCloaR3c1deY+i9gPfMDVdCQwm 7v8duMqUsAPpvor2geU4xhV2BXz7+3yW6GrDzlmKLKFHF88o8qNgrktEljdiGRHMo9 4t6a0qGoCH+U17r0aDom02tNBwS6PYzsKInPTTDFkNl9Fkd9fDLZiLFPP7KH0z6k6I ShJnH5m6HbzS9Jg5A32aSmSIikT4oxJJXl1pdHCVMEBftoUgVVAsqai0SjTNPeEuP4 Df8e5h3CrqYfQ== In-Reply-To: <20240513065931.0D83AC12C31@vcs2.savannah.gnu.org> (Juri Linkov's message of "Mon, 13 May 2024 02:59:30 -0400 (EDT)") 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, 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:319201 Archived-At: Hi Juri, Juri Linkov writes: > branch: master > commit 431f8ff1e38ca4367637c6b9fbc25d13d6f760a7 > Author: Juri Linkov > Commit: Juri Linkov > > * 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