From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel,gmane.emacs.orgmode Subject: Re: [FR] Allow flattened imenu index Date: Fri, 15 Dec 2023 14:13:58 +0200 Message-ID: <5adfabd1-fd5f-61d9-9731-ded7e8f1040d@gutov.dev> References: <87plzgbalt.fsf@localhost> <87msujskxg.fsf@localhost> <835y17y5qu.fsf@gnu.org> <874jgrsiyy.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36891"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: Eli Zaretskii , Morgan.J.Smith@outlook.com, emacs-orgmode@gnu.org, 58131@debbugs.gnu.org, emacs-devel@gnu.org To: Spencer Baugh , Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 15 13:14:29 2023 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 1rE75I-0009Ok-Lo for ged-emacs-devel@m.gmane-mx.org; Fri, 15 Dec 2023 13:14:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rE753-0006ZV-Oy; Fri, 15 Dec 2023 07:14:13 -0500 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 1rE751-0006Z6-K2; Fri, 15 Dec 2023 07:14:11 -0500 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rE74y-0006Mz-9F; Fri, 15 Dec 2023 07:14:11 -0500 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 996C43200AA9; Fri, 15 Dec 2023 07:14:03 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 15 Dec 2023 07:14:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1702642443; x=1702728843; bh=avXq8aDC4JoJpxMJiVgPUDsp6bxK6WlTGoRHV2YygVI=; b= MJuh3n6b5+Tl94qccduEogMTf7CQP/JquurpacBPOtqOTGORcdni3C6o4OguA9FO N3dQ7KpSdO8dewHtFlhEGCec9SSJUp2a1kKZMN3+//CJvc6gAU+DwcPCAkyUyL5F DKe6qAD9KsoXpF1kI9jW+4S2zL+FaX4j/OZwEL3HkL6mHWhY8VIXe4MlqvkEK+4R DIYtkQJ5Bk5onuj3tBYlIu47gnuIgwbMXU6zCVI3qCvGZw1PQdNdp4EaIW1ab+O5 EjuLzFavYzWv8XLgVoL87ym5jmryML57xo77m8ejjxDFXnspB4YzexAYPGk2JpDF mA4itG8TxazPi1Smfv5PPA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1702642443; x= 1702728843; bh=avXq8aDC4JoJpxMJiVgPUDsp6bxK6WlTGoRHV2YygVI=; b=2 x4HE+Qx3SWolWTBEHP9ZIUoJpLamO2h1EIMJwtIdVcPUl+2vQzo/g9bFswDjftuX OucH/KPmkRtcnXHjDztHTOIztGUgHVKKkuP8+YSE5QgMD1MJFTTdw7jNjyah9BDr +jzpZIIvip4lXFffgBCEmL2YZbMSNYRCpAwabZNW4l+w/TyoB0U6UyEQO4+zssWt 73ulhHxpmCtnFYZajr/lGSNUnk9ZAMLzEtskwDrBrA05STV2iyInV9ZdxMF6hVeT Mac4+4SNqHMHvPv/hPF46pYS/Si1SpyVfUFPsZupIx8tOy0DMykRXpYTP7IGizC8 Mnmj4n3CMqbUVu7zY0qTw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvddtvddgfeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 15 Dec 2023 07:14:00 -0500 (EST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=64.147.123.19; envelope-from=dmitry@gutov.dev; helo=wout3-smtp.messagingengine.com X-Spam_score_int: -47 X-Spam_score: -4.8 X-Spam_bar: ---- X-Spam_report: (-4.8 / 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, NICE_REPLY_A=-2.012, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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:313856 gmane.emacs.orgmode:158611 Archived-At: On 15/12/2023 01:11, Spencer Baugh wrote: > I have an alternative proposal though, which might be better: We could > enhance the imenu completion table to understand completion boundaries. > Then the imenu hierarchy could be completed over in a single > completing-read instead of a sequence of multiple completing-reads. It > would work the same way as read-file-name. > > So, for example, if the completion boundary was /, and we had a hierarchy > containing these elements: > aaa/bbb/ddd > aaa/bbb/eee > aaa/ccc/eee > aaa/ccc/fff > > You could choose aaa/bbb/ddd with this sequence of minibuffer contents: > (input in [brackets], point at |) > > [a] > a| > [] > aaa/| ; completion now shows bbb and ccc as options > [b] > aaa/b/d| > [TAB] > aaa/bbb/ddd| > [RET] > > Alternatively, you could choose aaa/bbb/eee with this sequence: > > [*/*/e] > */*/e| > [TAB] > aaa/|/eee ; completion now shows bbb and ccc as options, point is at | > [b] > aaa/b|/eee > [TAB] > aaa/bbb/eee| > [RET] > > To be very clear, these completion features already exist (and are > enabled by default!), all we would need to do is enhance the imenu > completion table to understand completion boundaries, and then imenu > would have access to these features too. > > This new completion table could be turned on by default, since it would > be strictly more powerful than the current imenu UI. > > Plus, if some alternative completion UI wanted to flatten the hierarchy > anyway, this more advanced imenu completion table would allow that. "Flattening" a completion table with boundaries is not too easy, though. The code that wants to do that (e.g. for vertico or Ido to show all entries flat right away) would need to perform a similar "traversal of the tree" to what they do now, only with some more advanced logic of examining c-t boundaries. Even so, your proposal would be an improvement for the default UI - one continued completion instead of a loop of completing-read's.