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.bugs Subject: bug#68214: Completion sorting customization by category Date: Thu, 04 Jan 2024 19:21:29 +0200 Organization: LINKOV.NET Message-ID: <86le95m2ue.fsf@mail.linkov.net> References: <86a5pnzst1.fsf@mail.linkov.net> <868r5630ft.fsf@mail.linkov.net> <8ebc33fb-d01f-4426-a716-69a11f6dfad1@daniel-mendler.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16663"; 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: 68214@debbugs.gnu.org To: Daniel Mendler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 04 18:23:18 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rLRR7-00048e-3k for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Jan 2024 18:23:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLRQr-0007Tx-0i; Thu, 04 Jan 2024 12:23:01 -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 1rLRQp-0007Tp-01 for bug-gnu-emacs@gnu.org; Thu, 04 Jan 2024 12:22:59 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLRQo-0000dW-O9 for bug-gnu-emacs@gnu.org; Thu, 04 Jan 2024 12:22:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rLRQs-00033d-Fn for bug-gnu-emacs@gnu.org; Thu, 04 Jan 2024 12:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Jan 2024 17:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68214 X-GNU-PR-Package: emacs Original-Received: via spool by 68214-submit@debbugs.gnu.org id=B68214.170438897811743 (code B ref 68214); Thu, 04 Jan 2024 17:23:02 +0000 Original-Received: (at 68214) by debbugs.gnu.org; 4 Jan 2024 17:22:58 +0000 Original-Received: from localhost ([127.0.0.1]:55597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rLRQn-00033L-Vv for submit@debbugs.gnu.org; Thu, 04 Jan 2024 12:22:58 -0500 Original-Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]:40627) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rLRQl-000335-Pu for 68214@debbugs.gnu.org; Thu, 04 Jan 2024 12:22:57 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 80FC6240004; Thu, 4 Jan 2024 17:22:44 +0000 (UTC) In-Reply-To: <8ebc33fb-d01f-4426-a716-69a11f6dfad1@daniel-mendler.de> (Daniel Mendler's message of "Wed, 3 Jan 2024 18:12:06 +0100") X-GND-Sasl: juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277322 Archived-At: >>> This function could be used to look up the other meta data >>> functions too, `display-sort-function`, `annotation-function`, >>> `affixation-function`, `group-function`, etc. >> >> All these meta data functions could be added later to >> completion-category-overrides after pushing the current patch. Now the patch is pushed to master. > Makes sense, the `display-sort-function' is a good start. I suggest to > at least add the `cycle-sort-function' too. The cycle threshold can be > customized too. Looks like the cycle threshold is already supported, so I'll add the other meta data. > For later - in some cases one may also want to customize the > `annotation-' or `affixation-function'. We have a whole package which > does only that - see Marginalia on GNU ELPA. In contrast to sorting, for > annotations one has to work a bit harder, since one may not have access > to locally let-bound candidate-related data, which is only accessible by > the completion table closure and not globally. I guess users should be able to customize completion-category-overrides in such a way that categories could be associated with Marginalia functions. So users could enable Marginalia for one category, and disable for another. >> Maybe customization of completion-category-overrides could support >> a catch-all category `nil` for completions without metadata, like >> e.g. `nil` can be used in .dir-locals.el as a catch-all for all modes. >> But I'm not sure how useful this would be. > > Okay. I suggest t instead of nil for the catch-all category. This seems > more aligned with other customization options or Lisp language > constructs like `cond'. This could be done as well.