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: Wed, 10 Jan 2024 09:35:41 +0200 Organization: LINKOV.NET Message-ID: <86ply9myia.fsf@mail.linkov.net> References: <86a5pnzst1.fsf@mail.linkov.net> <868r5630ft.fsf@mail.linkov.net> <8ebc33fb-d01f-4426-a716-69a11f6dfad1@daniel-mendler.de> <86le95m2ue.fsf@mail.linkov.net> <86sf3cjj6o.fsf@mail.linkov.net> <871qawrxh0.fsf@daniel-mendler.de> <86r0iuxu4f.fsf@mail.linkov.net> <87plye9wbz.fsf@daniel-mendler.de> <86wmslhvdk.fsf@mail.linkov.net> <87h6jpdm63.fsf@daniel-mendler.de> <86o7dul766.fsf@mail.linkov.net> <86il42l6gz.fsf@mail.linkov.net> <87jzoiqryx.fsf@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="34782"; 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 Wed Jan 10 08:39:03 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 1rNTB0-0008t6-Hr for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Jan 2024 08:39:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNTAu-0007fA-Cj; Wed, 10 Jan 2024 02:38:56 -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 1rNTAs-0007ee-NR for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2024 02:38:54 -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 1rNTAs-0001E1-FQ for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2024 02:38:54 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rNTAz-0007rX-OL for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2024 02:39:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Jan 2024 07:39: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.170487229330154 (code B ref 68214); Wed, 10 Jan 2024 07:39:01 +0000 Original-Received: (at 68214) by debbugs.gnu.org; 10 Jan 2024 07:38:13 +0000 Original-Received: from localhost ([127.0.0.1]:41638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNTAD-0007qH-2m for submit@debbugs.gnu.org; Wed, 10 Jan 2024 02:38:13 -0500 Original-Received: from relay3-d.mail.gandi.net ([2001:4b98:dc4:8::223]:41167) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNTAB-0007pz-L6; Wed, 10 Jan 2024 02:38:12 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id C379A60005; Wed, 10 Jan 2024 07:37:57 +0000 (UTC) In-Reply-To: <87jzoiqryx.fsf@daniel-mendler.de> (Daniel Mendler's message of "Tue, 09 Jan 2024 19:31:02 +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:277685 Archived-At: close 68214 30.0.50 thanks >>> Now I tried to use a more user-friendly let-binding of >>> 'completion-extra-properties' like below, but then discovered >>> that it doesn't work for the category. >>> >>> Maybe 'completion-metadata-get' could try to get a category >>> from 'completion-extra-properties' as well? >> >> Sorry, this was imprecise. I meant another layer of indirection: >> to get a category from 'completion-extra-properties' >> to be able to get 'display-sort-function' by category. > > Indeed. I forgot about this indirection. This should be added as well. > Not sure if there a significantly easier way to write this than as > follows with a separate helper function? I think other ways such as calling the same function recursively would be too ugly. But a separate function is more clear. > (defun completion--metadata-get-1 (metadata prop) > (or (alist-get prop metadata) > (plist-get completion-extra-properties > ;; Cache the keyword > (or (get prop 'completion-extra-properties--keyword) > (put prop 'completion-extra-properties--keyword > (intern (concat ":" (symbol-name prop)))))))) > > (defun completion-metadata-get (metadata prop) Now this is pushed as well. Since all existing metadata functions are completely covered now, it's time to close this feature request. Thank you for helping to bring this nice feature to fruition!