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: Completions group metadata [was: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846)] Date: Wed, 07 Aug 2024 09:56:02 +0300 Organization: LINKOV.NET Message-ID: <86frrgizy5.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> <86ttgs78eu.fsf@mail.linkov.net> <86msmj9adm.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="40520"; 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 Wed Aug 07 09:00:37 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 1sbaez-000AQP-E2 for ged-emacs-devel@m.gmane-mx.org; Wed, 07 Aug 2024 09:00:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbaeA-0001Cw-04; Wed, 07 Aug 2024 02:59:46 -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 1sbae7-0001C1-LX for emacs-devel@gnu.org; Wed, 07 Aug 2024 02:59:43 -0400 Original-Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbae5-00041j-Bt; Wed, 07 Aug 2024 02:59:43 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id BDE2E1BF205; Wed, 7 Aug 2024 06:59:25 +0000 (UTC) In-Reply-To: (Eshel Yaron's message of "Tue, 16 Jul 2024 08:57:08 +0200") X-GND-Sasl: juri@linkov.net Received-SPF: pass client-ip=2001:4b98:dc4:8::228; envelope-from=juri@linkov.net; helo=relay8-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:322479 Archived-At: >>> - If completions-group is also non-nil, then group candidates according >>> to their prefix and trim the prefix in the group-function when >>> transforming candidates for display. >> >> The disadvantage of completions-group is its too wide coverage. >> We should strive for more specific options where possible. > > Right. The advantage, on the other hand, is that you can toggle > completions-group on the fly in the minibuffer, either with > toggle-option or with a dedicated command. The wide coverage of > completions-group means there's just one variable to toggle, always. Interesting. Then this requires such precedence (from high to low): buffer-local value of completions-group -> metadata -> default-value of completions-group >> Or better: let's enable groups by category. I don't know why we have >> such a glaring omission that groups still can't be enabled by >> category. This should be simple to implement: > > Doesn't the group-function metadata entry give enough control already? It's not easy for users to customize group-function metadata by writing own group function. Whereas with a boolean its easy to toggle it in the Customization UI for completion-category-overrides. > If a category or a specific completion table wants to disable grouping, > it can simply avoid providing a group-function. If it wants to enable > grouping, then it does provide a group-function, and now it's up to the > user's preferences which they express by setting completions-group. > Maybe your suggestion yields more flexibility in some cases? It makes sense to provide a group-function disabled by default to help users just to enable it in completion-category-overrides instead of writing it from scratch.