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: Thu, 16 May 2024 09:08:21 +0300 Organization: LINKOV.NET Message-ID: <861q62pb8y.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22605"; 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: Eli Zaretskii , Stefan Monnier , emacs-devel@gnu.org To: Eshel Yaron Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 16 08:11:56 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 1s7ULL-0005fv-BR for ged-emacs-devel@m.gmane-mx.org; Thu, 16 May 2024 08:11:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7UKx-0008E9-6o; Thu, 16 May 2024 02:11:31 -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 1s7UKv-0008E1-UG for emacs-devel@gnu.org; Thu, 16 May 2024 02:11:29 -0400 Original-Received: from relay3-d.mail.gandi.net ([2001:4b98:dc4:8::223]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s7UKs-0001an-SD; Thu, 16 May 2024 02:11:29 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 075876000A; Thu, 16 May 2024 06:11:19 +0000 (UTC) In-Reply-To: (Eshel Yaron's message of "Wed, 15 May 2024 20:30:47 +0200") X-GND-Sasl: juri@linkov.net Received-SPF: pass client-ip=2001:4b98:dc4:8::223; envelope-from=juri@linkov.net; helo=relay3-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:319281 Archived-At: >> +*** New variable 'completion-allow-text-properties'. >> +Like non-nil 'minibuffer-allow-text-properties' that doesn't discard >> +text properties, it does the same by keeping text properties >> +on the selected completion candidate. So when these two variables >> +both are non-nil then 'completing-read' returns a selected completion >> +with the initial text properties kept intact. > > Note that when minibuffer-allow-text-properties is non-nil, you can > already get the same original text properties from completing-read if > you "select" your candidate by cycling, since that doesn't go through > choose-completion which strips text properties. It feels a bit > surprising to have this separate variable that affects one kind of > selection ("choosing") and not other kinds ("cycling", "expanding"). > IMO, it'd be better, if possible, to just cease stripping text > properties in choose-completion altogether. Note that choose-completion > calls completion--replace to do the actual insertion, and that function > already respects minibuffer-allow-text-properties. I agree that a new variable is unnecessary, so it would be better just to preserve text properties in choose-completion unconditionally. Unless there are objections this looks like the right thing to do. >> (let ((name (thing-at-point 'symbol)) >> choice >> + (minibuffer-allow-text-properties t) >> + (completion-allow-text-properties t) > > IIUC, these let-bindings around completing-read will affect all > recursive minibuffers too, and even completion-at-point completions if > you start editing another buffer before exiting the minibuffer. Perhaps > we can use buffer-local bindings in the minibuffer and propagate them to > the completions list buffer when populating it instead of let-binding? This problem could be solved much easier if we avoid adding a new variable completion-allow-text-properties. Then we can set only the existing variable minibuffer-allow-text-properties in the minibuffer.