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: Sun, 14 Jul 2024 09:53:05 +0300 Organization: LINKOV.NET Message-ID: <86ttgs78eu.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23482"; 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 Sun Jul 14 09:18:20 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 1sStUx-0005yf-Oa for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Jul 2024 09:18:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sStUN-0003H6-4h; Sun, 14 Jul 2024 03:17:43 -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 1sStUL-0003Gs-PV for emacs-devel@gnu.org; Sun, 14 Jul 2024 03:17:41 -0400 Original-Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sStUJ-0004FY-9P; Sun, 14 Jul 2024 03:17:41 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 86989E0002; Sun, 14 Jul 2024 07:17:31 +0000 (UTC) In-Reply-To: (Eshel Yaron's message of "Sun, 14 Jul 2024 08:28:36 +0200") X-GND-Sasl: juri@linkov.net Received-SPF: pass client-ip=2001:4b98:dc4:8::224; envelope-from=juri@linkov.net; helo=relay4-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, 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:321632 Archived-At: > I'm afraid imenu-flatten=annotation has one more hurdle to overcome. > Consider: > > 1. emacs -Q > 2. (setq imenu-flatten 'annotation) > 2. C-x C-f .../lisp/imenu.el > 3. M-g i > 4. M- M- M- M- ... > 5. Now the selected candidate in *Completions* is e.g. imenu--cleanup, > this is also the minibuffer contents, so far so good. > 6. Type M-RET to jump to this candidate. > 7. Land on imenu instead of imenu--cleanup. > > No matter how far down you go with M-, if you go through the entry > for imenu, that's where you'll land when you hit M-RET. This is because > imenu-flatten=annotation tries to identify candidates by their text > properties, but completion--replace retains common parts while replacing > minibuffer text, along with the text properties of these common parts. > > This affects imenu-flatten=group too. > > It might be possible to resolve this by setting a different > completion-list-insert-choice-function that circumvents replaces the > whole minibuffer contents, unlike completion--replace, which tries hard > to preserve markers etc. Maybe then imenu--completion-buffer should try to get the text property from the end of completion? Provided that completion--replace will keep some properties at the end instead of using insert-and-inherit.