From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] `completing-read`: Add `group-function` support to completion metadata (REVISED PATCH) Date: Thu, 29 Apr 2021 20:55:32 +0300 Message-ID: References: <0bbdeece-90d5-160c-07ec-2ad8edbf9872@daniel-mendler.de> <87czudm7bv.fsf@mail.linkov.net> <9de0a112-9e68-d645-451e-084a3c7c6725@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15841"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 Cc: Gregory Heytings , Stefan Monnier , "emacs-devel@gnu.org" To: Daniel Mendler , Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 29 19:56:35 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 1lcAtv-00043b-7K for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Apr 2021 19:56:35 +0200 Original-Received: from localhost ([::1]:53416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcAtu-0005Ls-9x for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Apr 2021 13:56:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcAt0-0004Q4-V8 for emacs-devel@gnu.org; Thu, 29 Apr 2021 13:55:39 -0400 Original-Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:39813) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lcAsz-0006XC-0B for emacs-devel@gnu.org; Thu, 29 Apr 2021 13:55:38 -0400 Original-Received: by mail-wm1-x335.google.com with SMTP id i21-20020a05600c3555b029012eae2af5d4so208394wmq.4 for ; Thu, 29 Apr 2021 10:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=u4m3kf/dkOJXIvyyGHY4CUIw0UIdgY1WllupHuWW27w=; b=qhp8qAuESwr3C0xxO1o10HvEWvisw0+Y9nNATb+Qoj0emziv0wqtzcrqME7sXGFYet WkPjss7gsXXCk6xb+aOsR5U1hkFacXMXv012yvbTT38PYnI0jOabzoGTmAeN3NcA1ooG QVP9YRWriale9DHLmxl42ayXrIeEExiNs/nwIv9HXJDveXWnhdfC6xwpcFXGWXbu/1wm AcYhJ7h18O14fb/4e4lpZNAwHDlgXto/W/XAWYq+Zi1MOBITvyW5VhWTqgaVClVFnhCy U9UO198WyFa554GlijC3VG5cpOwSsTl5uoMRpf+aUeJa3TL4hjxp/muZoMzWZTrJOIXn WL+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=u4m3kf/dkOJXIvyyGHY4CUIw0UIdgY1WllupHuWW27w=; b=mi+Kg/NvDfvCdqQ0VXbCfzqMfnThlh7fXkTTPq7rXY1twIi5Ux9G23kX4juKinhOLB 2lbIH03d3oUOUj1gKHkIfzkDnfAo0hjAi04mCJJAU9zwpDBd00rhw2EmuZ/tKpEc+1AJ tSOoGjzDTpAChSeg39IkKnWcjSNvdr487sVG8rDqHjNlrrUlNHZBPJWW9FFUz5M1j775 1ZrVlPi9OrWRSqj7EXGb4LdRU50oN44/ibJa3qwCxpcgAzfNNC504MqlWh2Vgs7m6FYs ivgW09MnL2ml+yei1rzZ2uJ2bv/5KQiyY0qCGL9sDxl4fo9o9FHoeJIs9VXXS1vJeMMz THHg== X-Gm-Message-State: AOAM532Y+6BmNvOf0mBgu8K2VGudS8QuzGtFnP30ksS75vtJvzt9x0aZ KBZ8Ty55DA5iy6ZkguJbz8o= X-Google-Smtp-Source: ABdhPJxgsJyUnXOgiiSYssjhfX5KEbgVYgQXD2p6aykD6EkAEu0hExS0yIRQ4ovZpW5UmKOwwgxQ0w== X-Received: by 2002:a1c:7315:: with SMTP id d21mr1422126wmb.155.1619718935271; Thu, 29 Apr 2021 10:55:35 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id q16sm797880wmj.24.2021.04.29.10.55.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Apr 2021 10:55:34 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=raaahh@gmail.com; helo=mail-wm1-x335.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:268632 Archived-At: On 29.04.2021 20:16, Daniel Mendler wrote: > On 4/29/21 7:09 PM, Dmitry Gutov wrote: >> If affixation-function didn't return a three-element list (and instead >> only returned some focused information pertaining to a single value), >> you wouldn't have this problem. > > I don't understand the argument here. It's an argument about being able to "do more with less", and as a side-effect not have to worry about resolving potential conflicts in duplication of information. > From my perspective the > `affixation-function` is good as is. It is a generalization of the > `annotation-function` which allows transformation of all candidates at > once and it additionally allows prefixes. However one could discuss if > the affixation function should be allowed to transform the actual > candidate string, as has been mentioned in the discussion before. I > think one can set text properties but one is not allowed to change the > candidate string - this will break `choose-completion`. I don't think anything like this necessarily has to break 'choose-completion': the UI can remember the mapping between "transformed" and actual completion strings. It's just extra complexity in implementation. On the higher level, though, I do believe completion tables should not define _presentation_, only information (with some well-defined exceptions, maybe).