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: [PATCH] (icomplete-vertical-mode): Add support for affixations and, annotations Date: Sun, 23 May 2021 22:04:07 +0100 Message-ID: <87pmxhb1rs.fsf@gmail.com> References: <87zgwlb4xc.fsf@gmail.com> <617d06ca-27bf-2ae8-26eb-1042123499d3@daniel-mendler.de> 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="21112"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Juri Linkov , monnier@iro.umontreal.ca, "emacs-devel@gnu.org" To: Daniel Mendler Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 23 23:04:49 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 1lkvHE-0005HY-Hy for ged-emacs-devel@m.gmane-mx.org; Sun, 23 May 2021 23:04:48 +0200 Original-Received: from localhost ([::1]:58832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkvHC-0006oC-Tf for ged-emacs-devel@m.gmane-mx.org; Sun, 23 May 2021 17:04:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkvGf-00068e-45 for emacs-devel@gnu.org; Sun, 23 May 2021 17:04:13 -0400 Original-Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:43862) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lkvGd-0002W2-4Y for emacs-devel@gnu.org; Sun, 23 May 2021 17:04:12 -0400 Original-Received: by mail-wm1-x335.google.com with SMTP id z85-20020a1c7e580000b029017a76f3afbaso7394216wmc.2 for ; Sun, 23 May 2021 14:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=hiSM07/55k08N0coSk2rhWNG4h3GqJPGax5aR3n8JbA=; b=fYHOavKZQLrccyazcmN1YKRSHc/lshkj3TZ2UziP/qUj0yzuOS8FDOUQYuW0BHtC48 8BoH0D80I3EEDaHjpsWzD36a2vQKtKD7m30UXzauXa1F7o/3GXT8ZHMU7+TJcElGd7o3 xsIobdDaKVsn8AoLe9TB9kzB8ctZjF2eFJnBVNb9lUzchy+qDfCcn1Y0WWBfz6UDMS6O SSslpIIBQG+/1wLoytIyytMzNeBJpzQhCuLvVkD18s8jrjtw81eXeXgg7L+yptKeWZo1 cnezUCbGdv2F6ZI+R8s7l0IheCfiwC41WzK8TkDBj0GfP0DqCVcLNbXluQUf32LYeptp yqhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=hiSM07/55k08N0coSk2rhWNG4h3GqJPGax5aR3n8JbA=; b=V3cw6svGOZv4X9QKgACFOqpyfUa63c5eOHvWdXYD6o/7PMiJV4Zlkj4P+82R6L9Dft hXIK3aNmj2cSkPDTY2VjVZCketUZFc8PFPtt/QjgqHL9IPKwtLpoRROG2JD7NM0EjAcG KHXHoavkCRrD1vA0iwXVmgHCau4rBmMrJkegm+NqHaNN2qdZDPeULgfx6oc+k60G6K0U XDzP2bqNIsNsr8dVgXV8Ryj5oV9Iy6dL+Mbmg/hpKqFKIpCep6e0BRBQtDYzQyDmikrm Fvr/9X2vQVxBEgIRCiGntQJ49NLUFIYqLJbmWCKtDVcu/jJMm34hrKYgzTDF7dVVA1f+ pdUg== X-Gm-Message-State: AOAM532CH0Wq3QpvZkc2lMwaQI1cuyyd8uC/SLr0X2OuKgCMfnQU6yHa DMKRgk8ZfQM9NwkCO2+PryE= X-Google-Smtp-Source: ABdhPJyoAhIWMbCZhegcVHLvQhaXPk1ZWkkK+knoP6xiinx9OIPb+TJ9XnEFfocBL5NriPssBXDZ0Q== X-Received: by 2002:a05:600c:3591:: with SMTP id p17mr17406147wmq.73.1621803849372; Sun, 23 May 2021 14:04:09 -0700 (PDT) Original-Received: from krug (a94-133-55-152.cpe.netcabo.pt. [94.133.55.152]) by smtp.gmail.com with ESMTPSA id c6sm10073103wru.50.2021.05.23.14.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 May 2021 14:04:08 -0700 (PDT) In-Reply-To: <617d06ca-27bf-2ae8-26eb-1042123499d3@daniel-mendler.de> (Daniel Mendler's message of "Sun, 23 May 2021 22:14:12 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=joaotavora@gmail.com; helo=mail-wm1-x335.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:269702 Archived-At: Daniel Mendler writes: > Ah, I forgot to tell you that. The M-x annotations are guarded by > `suggest-key-bindings`. Thanks, I see it. > I have not been involved in the initial design of this, the > `affixation-function` is there for quite a while already. 6 months, not very long in Emacs release terms. But indeed you're right that it wasn't last week.. > I would also be happy with an extension to the `annotation-function`, > where the returned annotation string is the suffix and can be > propertized with an additional string for the prefix. Either that, or it could return a list instead of a string, and then the list would be interpreted as "affixation function" results. >> I also don't understand why :affixation-function is given a full list of >> completions, when it is presumably meant to return a list of exactly the >> same length. Seems like a potential hazard to allow this function to do >> filtering. > > It is not allowed by the definition of the function. Yes, but users love to foot-shoot and who is going to enforce that? Your icomplete patch doesn't, for example. Whereas if it were a unary function of a completion string, the hazard wouldn't exist. In the meantime, I've read some of https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg00613.html and it seems one purported advantage of having `affixation-function` see all the candidates is to be able to do layout decisions since it knows the longest and shortest candidate. At least this is what I read from https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg01009.html But I don't understand why these decision should be done in the data backend. The backedn should only annotate a completion with a possible _hint_ on how to layout ("prefix" and "suffix" are hints). It's the frontend, who is who knows what to display and where, who should be responsible for the layout. >> So, unless I am missing something (known to happen), this seems like a >> misdesign which would be nice to correct before the Emacs 28 release >> and/or too many external packages start relying on this. > > For what is worth, my packages already rely on this. But I would have > this changed quickly given a modified definition of the > `annotation-function`. I am not aware of other packages already using > this functionality (I searched around for this at some point). That's valuable information. Let's wait for Juri and Stefan on this. Jo=C3=A3o