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: Updating *Completions* as you type Date: Wed, 18 Oct 2023 20:32:09 +0300 Organization: LINKOV.NET Message-ID: <86zg0fu99i.fsf@mail.linkov.net> References: <87bkd3z9bi.fsf@catern.com> <86cyxjyr1y.fsf@mail.linkov.net> <86r0lxm7um.fsf@mail.linkov.net> <87sf6dx954.fsf@catern.com> <87ttqpwea9.fsf@catern.com> <86wmvlw178.fsf@mail.linkov.net> <87bkcwx3ft.fsf@catern.com> <86y1g076vh.fsf@mail.linkov.net> <87sf68unh1.fsf@catern.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2347"; 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: emacs-devel@gnu.org To: Spencer Baugh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 18 19:36:49 2023 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 1qtATQ-0000Pj-R5 for ged-emacs-devel@m.gmane-mx.org; Wed, 18 Oct 2023 19:36:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtASu-00016B-Iu; Wed, 18 Oct 2023 13:36:17 -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 1qtASo-00015C-HL for emacs-devel@gnu.org; Wed, 18 Oct 2023 13:36:11 -0400 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtASn-0001rt-0J for emacs-devel@gnu.org; Wed, 18 Oct 2023 13:36:10 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 67A381C0007; Wed, 18 Oct 2023 17:36:05 +0000 (UTC) In-Reply-To: <87sf68unh1.fsf@catern.com> (Spencer Baugh's message of "Wed, 18 Oct 2023 12:25:15 +0000 (UTC)") X-GND-Sasl: juri@linkov.net Received-SPF: pass client-ip=217.70.183.197; envelope-from=juri@linkov.net; helo=relay5-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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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:311559 Archived-At: >> Actually there is already a nil value in completions-sort with the tag >> "No sorting". This works nicely for 'C-x b'. The remaining need is >> to be able to set it only for 'C-x b', not for other completion types. > > I feel quite strongly that we should not extend completions-sort to be > able to affect different completion types differently. Instead I think > we should leave completions-sort as a blanket configuration for what to > do if the completion metadata does not specify display-sort-function, > and if we want to allow customizing an individual completion type, that > completion type should specify a display-sort-function which can be > customized. > > If we do extend completions-sort to affect different completion types > differently, I expect we'll see lots of silly things, like packages with > new completion types which automatically install changes to > completions-sort instead of just specifying their own > display-sort-function. Probably different completion types should provide separate options such as e.g. 'read-char-by-name-sort' defines 'display-sort-function' for 'read-char-by-name'. The same could be added for 'C-x b'. But unfortunately currently it's hard-coded in 'internal-complete-buffer': #+begin_src c else if (EQ (flag, Qmetadata)) return list3 (Qmetadata, Fcons (Qcategory, Qbuffer), Fcons (Qcycle_sort_function, Qidentity)); #+end_src