From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] `completing-read`: Add `group-function` support to completion metadata (REVISED PATCH VERSION 2) Date: Tue, 11 May 2021 22:22:43 +0300 Message-ID: <83h7j93wjg.fsf@gnu.org> References: <0bbdeece-90d5-160c-07ec-2ad8edbf9872@daniel-mendler.de> <87czudm7bv.fsf@mail.linkov.net> <976056e8-3d46-db27-32c2-ddf3ca32d5a7@daniel-mendler.de> <878s5090e9.fsf@mail.linkov.net> <69fd42ed-a1a0-adcb-ac8b-caad80cb0967@daniel-mendler.de> <878s4zzpvc.fsf@mail.linkov.net> <95ac7ef3-5e8c-fc58-b316-544096c82aa0@daniel-mendler.de> <87o8dus00b.fsf@mail.linkov.net> <6718c89f-88a0-b529-1676-7e89fc152f00@daniel-mendler.de> <878s4w3law.fsf@mail.linkov.net> <87sg2ymq6j.fsf@mail.linkov.net> <87r1ifpyuc.fsf@mail.linkov.net> <83eeef7nzh.fsf@gnu.org> <87eeed2l0q.fsf@mail.linkov.net> <83o8dh3ybw.fsf@gnu.org> <854d8dbc-b64c-77e1-843b-95ac19e230e2@daniel-mendler.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38952"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gregory@heytings.org, dgutov@yandex.ru, emacs-devel@gnu.org, monnier@iro.umontreal.ca, juri@linkov.net To: Daniel Mendler Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 11 21:23:36 2021 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 1lgXyi-000A1h-0Y for ged-emacs-devel@m.gmane-mx.org; Tue, 11 May 2021 21:23:36 +0200 Original-Received: from localhost ([::1]:58698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgXyh-0003uA-4I for ged-emacs-devel@m.gmane-mx.org; Tue, 11 May 2021 15:23:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgXxv-0003A6-Qo for emacs-devel@gnu.org; Tue, 11 May 2021 15:22:47 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:33828) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgXxu-0005UG-PA; Tue, 11 May 2021 15:22:46 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1795 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgXxr-0004QQ-EA; Tue, 11 May 2021 15:22:46 -0400 In-Reply-To: <854d8dbc-b64c-77e1-843b-95ac19e230e2@daniel-mendler.de> (message from Daniel Mendler on Tue, 11 May 2021 20:58:33 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:269183 Archived-At: > Cc: gregory@heytings.org, dgutov@yandex.ru, monnier@iro.umontreal.ca, > emacs-devel@gnu.org > From: Daniel Mendler > Date: Tue, 11 May 2021 20:58:33 +0200 > > On 5/11/21 8:44 PM, Eli Zaretskii wrote: > > And this is supposed to be progress? to force users to customize > > sorting by providing their own functions? IMO, it is a step backward, > > not forward: we are making Emacs harder to use for everyone who isn't > > a Lisp programmer. > > What about providing a group sort function which sorts alphabetically as > Juri already proposed? Alphabetical sorting can be offered as choice for > in the defcustom. That's slightly better, but only slightly: you still expect users to manipulate functions, something that they don't necessarily understand well enough. Why not provide a defcustom that can accept both simple value, for the most popular sort methods, and also allow function values for advanced users? > (defcustom completions-group-sort-function #'identity > "Sorting function for the groups. > The function takes and returns an alist of groups, where the each > element is a pair of a group title string and the candidate strings > belonging to the group." Thanks. Now try putting yourself into the shoes of a newbie and try imagining what can he/she make out of this doc string. "Function taking and returning an alist"? really?