From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler Newsgroups: gmane.emacs.bugs Subject: bug#68214: Completion sorting customization by category Date: Wed, 3 Jan 2024 18:12:06 +0100 Message-ID: <8ebc33fb-d01f-4426-a716-69a11f6dfad1@daniel-mendler.de> References: <86a5pnzst1.fsf@mail.linkov.net> <868r5630ft.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31850"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68214@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 03 18:13: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 1rL4nt-00082h-Qw for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Jan 2024 18:13:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL4nd-0003XS-W5; Wed, 03 Jan 2024 12:13:02 -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 1rL4nb-0003XE-IW for bug-gnu-emacs@gnu.org; Wed, 03 Jan 2024 12:12: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 1rL4nb-0007bB-A6 for bug-gnu-emacs@gnu.org; Wed, 03 Jan 2024 12:12:59 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rL4ne-0006rw-0J for bug-gnu-emacs@gnu.org; Wed, 03 Jan 2024 12:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Jan 2024 17:13:01 +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.170430194126353 (code B ref 68214); Wed, 03 Jan 2024 17:13:01 +0000 Original-Received: (at 68214) by debbugs.gnu.org; 3 Jan 2024 17:12:21 +0000 Original-Received: from localhost ([127.0.0.1]:53131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rL4mz-0006qz-0D for submit@debbugs.gnu.org; Wed, 03 Jan 2024 12:12:21 -0500 Original-Received: from server.qxqx.de ([2a01:4f8:121:346::180]:60599 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rL4mv-0006qk-Pj for 68214@debbugs.gnu.org; Wed, 03 Jan 2024 12:12:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=M5lYdvadimWRq+8bQ9JNIlCdCPX4jvTXkRMN50V2M5o=; b=yD6SBHfN2PHued6T5JtinLy8fO GMgSCG/nB/tu5C/X5Wl1mspCNx29+n0jY+Ov52WwS3zrWtN+KX5M+RT3HBvZKBz2u1izkYUKs6k8h wq+uYAEbPdC8iqbSLwjfOJVslpwv0E0ftXg7bYQL3QFl2MpiqNFzGChvf5Z1+yphvSHw=; Content-Language: en-US In-Reply-To: <868r5630ft.fsf@mail.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:277277 Archived-At: On 1/3/24 17:07, Juri Linkov wrote: >> 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. 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. 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. > 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'. Daniel