From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: complexity in minibuffer Date: Wed, 2 Jun 2021 16:20:30 +0100 Message-ID: References: <22880197-6d05-c821-2c58-328ed3cfc02e@daniel-mendler.de> <87eedruui3.fsf@gmail.com> <8dd915fe-fe67-2a45-67ff-8aaa3e9b9aca@daniel-mendler.de> <878s3zuq47.fsf@gmail.com> <09f2a253-84ba-5cfd-552e-0b89109864a5@daniel-mendler.de> <875yyxaoxp.fsf@gmail.com> <871r9laj6a.fsf@gmail.com> <1b73a130-204c-76fb-2b60-02b814aee0f0@daniel-mendler.de> <87r1hl8xom.fsf@gmail.com> <878s3t8tzw.fsf@gmail.com> <3c68bd00-70ca-fa18-f9b8-cd03029f9294@daniel-mendler.de> <8735u18lsd.fsf@gmail.com> <8e33bbfe-0015-b85c-b57c-ba448f2e6215@yandex.ru> <3d519805-f602-fa52-ec69-0506bb6cb568@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4260"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Daniel Mendler , Juri Linkov , "emacs-devel@gnu.org" , Dmitry Gutov To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jun 02 17:21: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 1loSga-0000t8-Kz for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Jun 2021 17:21:36 +0200 Original-Received: from localhost ([::1]:45726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loSgZ-0002ir-N5 for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Jun 2021 11:21:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loSfm-0000kz-NX for emacs-devel@gnu.org; Wed, 02 Jun 2021 11:20:46 -0400 Original-Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:43523) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1loSfj-0000Rm-Pg for emacs-devel@gnu.org; Wed, 02 Jun 2021 11:20:46 -0400 Original-Received: by mail-pg1-x52e.google.com with SMTP id e22so2494349pgv.10 for ; Wed, 02 Jun 2021 08:20:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=+IDuFemm9dXMoRnzUF3brWbv12C2O2tRPYoEJ8PRoL4=; b=VvFABNzV+4Xqt9JnJtHtMGvL3aHKGcASLcyh9++aOeVBbAUy1wx/PruNKi8S4AAIIO R18+Z6vGDnkKasHT3taY+ZZaG7wMWB4xBGp0rkMJ8G7NDfEE7N9SmuTXRvuU2uInGYad YIN0eYuBXsC2cdSqBKB3D4ME7wiZfa/dcC+FqGwXTek8kwCypEnmvm2u6eqYOwTi2UBv u6NHiKiey9RMuYkq9j1Ex27FRqt83lwLzO8wPTvERydqB2NyzNvyBZR53yWGVeWAeZsj kCC65giOw1ONqjU4627Lw/tSjeERrbwBOBnPbRDZijDV120aNsifp5ns7A6Q/RyangmJ wUYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=+IDuFemm9dXMoRnzUF3brWbv12C2O2tRPYoEJ8PRoL4=; b=Nvofrtki1xgSLdQmpgSYmZyN4DFmGYjSUB6V1brRVSvsW9J/kCjdqA4DYb6LOiPrl+ 3GX0/KD0/64gF/ABh29gmFANWyABEDjLUlMo+JDoSTjsefwPZuDgUbFscxZNU0/+0mII lyD/fkStb1cuqjUAgRms1B3AMz5/1yvv1gYo6u06f4Dsh/tZ9ruyNPL78bd0uLvkBAXO 5p5GyyiHBsah7aSnCudCDvfdKuHXPStQn4hiJJ3xO7uPXPzve4wiGnvGChCrqIpbUHss kKJy7KrqHDt3DuTKQeAMct6lFj3EXMLXi9JUr9f02RzkyvK/85FlX+6RjrXbWqv+obZx 8fJA== X-Gm-Message-State: AOAM531//UuDLkT6ly4R9T2eLH6qZnVpR4GOSukrxCWUj9tJYEI+VhkI EaYLahjQ7VSxAvgY5YbkH0qwMrjCKfjbQ4zlIXo= X-Google-Smtp-Source: ABdhPJxT8Jm+4YxqbG5SgLVGNhwpcw83rxvIIRsZ6hVmN7zaBpfst06Lyey894HPV58p3UYZ+5ym4dk5IeyzDNUgoZc= X-Received: by 2002:a62:30c2:0:b029:289:116c:ec81 with SMTP id w185-20020a6230c20000b0290289116cec81mr27942201pfw.42.1622647241839; Wed, 02 Jun 2021 08:20:41 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=joaotavora@gmail.com; helo=mail-pg1-x52e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:270302 Archived-At: On Wed, Jun 2, 2021 at 4:06 PM Stefan Monnier wr= ote: > > > Yes (but on only) And those were the functions who now get an optional > > group-fun arg (also often 'if'ed against sometimes only threaded). > > I suspect they should get an `md` argument instead (which will include > the `group-function`, of course). That works, of course. Many things work, but this is not the simplest. By that time, you have already traversed the completion list many times. What's the problem with having the completions themselves contain all that's needed to render them? A negligible amount of allocation in a ocean of allocations? Why do we have to pass down the API call all to way to the display? Let's have it so that at a certain point, a collection of completions (whatever the format of collection and/or completion) is enough to draw them, no more dependency on global state or multiple funky arguments that are hard to mock. Less if's. Great for automated testing, too. > > I think it has to do with the way Juri (or someone else) implemented > > affixation function and annotation function, which was what I was tryin= g > > to touch to experiment with resolution-function ideas. Sometimes as com= pletion > > is represented by a cons (string annotation-prefix annotation-suffix) > > sometimes only a string. It could be a string always, with properties. > > Or a struct. But let's leave it at string and never cons. > > I don't have a strong opinion here, except that I think it would make > sense to handle `group-function` and `annotation/affixation-function` at > the same place. You do have to call the first on all of the completions and the latter only on a subset to be displayed. That's a constraint of the problem itself. Jo=C3=A3o