From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] `completing-read`: Add `group-function` support to completion metadata (REVISED PATCH) Date: Thu, 29 Apr 2021 13:07:04 -0400 Message-ID: References: <0bbdeece-90d5-160c-07ec-2ad8edbf9872@daniel-mendler.de> <87czudm7bv.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33122"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Daniel Mendler , Gregory Heytings , Dmitry Gutov , "emacs-devel@gnu.org" To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 29 19:34:59 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 1lcAZ1-0008SG-50 for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Apr 2021 19:34:59 +0200 Original-Received: from localhost ([::1]:51668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcAZ0-0000oE-59 for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Apr 2021 13:34:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcA8Q-0005r8-6w for emacs-devel@gnu.org; Thu, 29 Apr 2021 13:07:30 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:27935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcA8J-0006Yg-EP for emacs-devel@gnu.org; Thu, 29 Apr 2021 13:07:29 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B18DA807A5; Thu, 29 Apr 2021 13:07:06 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 48B4080533; Thu, 29 Apr 2021 13:07:05 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1619716025; bh=4Xur9Ja1j3QfQpEWXDEDUiJF2abwnLkoG2IMvRaXCUo=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=A8b2OkMwlKaVB+dhkdm7KxJXnKpMJFgoyPzO2Vifq0Q9KFOYd4aOrTCol2vZ8toiV ZRSIX8AtAIghzbZCTZd1Zp/plbuLnMPBQyIDuP+8FcwdcKMXLxorfko9I78AV0ElqA ZHMmsANf92IxZrXArBZjyEYHsXmT5qKBya/ng8aCrRCr/A5AMd+/9va4d7QuAfsVpu NmhNNuFkQ5zhj4OlhEs0qkcRvCk+ItuYF6dWvUWPzZ1J/C9KGb2KJFnm8RZAHCdPtz pX+5Y5/JkDEXm9qsqyknFfx5Jmxz71uQWI9R6IUkmlxt71FzmUX6RjzG/c8x+yp8hD Nwb+T/VNR0Cxw== Original-Received: from alfajor (unknown [157.52.10.47]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 126DA120929; Thu, 29 Apr 2021 13:07:05 -0400 (EDT) In-Reply-To: <87czudm7bv.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 29 Apr 2021 19:20:04 +0300") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=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.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:268626 Archived-At: > OTOH, it highlighted the shortcomings of amalgamating both > grouping and transforming in the same function: > mule--ucs-names-group doesn't need to provide transformation, > because the same affixation-function is used for both > grouping and non-grouping completions. The purpose of the `group-function` when called with a non-nil `transform` arg is not to *add* text but on the contrary to make the entries shorter (presumably by removing text shared by all elements of the group and made redundant by the group name being printed as a "section title"). So the purpose of `affixation/annotation-function` and `group-function` seem orthogonal (tho we should be careful to make them work together: the affixation/annotation function will usually need the "full name" in order to decide what to add, but that the thing should be added to the text as shortened by `group-function`). Stefan