From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Simplification of `affixation-function` Date: Sun, 25 Apr 2021 00:41:31 +0300 Organization: LINKOV.NET Message-ID: <878s575pis.fsf@mail.linkov.net> References: <87y2d777r2.fsf@mail.linkov.net> <9ca07e0f-48f9-ba21-068c-694453fc79d8@daniel-mendler.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37735"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Daniel Mendler Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 24 23:45:20 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 1laQ5Y-0009gz-BP for ged-emacs-devel@m.gmane-mx.org; Sat, 24 Apr 2021 23:45:20 +0200 Original-Received: from localhost ([::1]:54168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1laQ5X-0001Kg-B0 for ged-emacs-devel@m.gmane-mx.org; Sat, 24 Apr 2021 17:45:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48804) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1laQ4j-0000vz-Lc for emacs-devel@gnu.org; Sat, 24 Apr 2021 17:44:29 -0400 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:55575) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1laQ4h-00031w-Aw for emacs-devel@gnu.org; Sat, 24 Apr 2021 17:44:29 -0400 X-Originating-IP: 91.129.102.166 Original-Received: from mail.gandi.net (m91-129-102-166.cust.tele2.ee [91.129.102.166]) (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id EB13B1BF203; Sat, 24 Apr 2021 21:44:22 +0000 (UTC) In-Reply-To: <9ca07e0f-48f9-ba21-068c-694453fc79d8@daniel-mendler.de> (Daniel Mendler's message of "Sat, 24 Apr 2021 23:17:56 +0200") Received-SPF: pass client-ip=217.70.183.201; envelope-from=juri@linkov.net; helo=relay8-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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:268347 Archived-At: > I think it is slightly confusing and unnecessarily complicated. But if you > want to retain backward compatibility, there is no way back. However since > the `affixation-function` has only been introduced recently, there should > still be a time window to change the definition? There is no released > version of Emacs with `affixation-function` support. > > (If it is decided to change the definition it should be feasible to go over > all ELPA/MELPA and apply patches to all packages which already make use of > the `affixation-function`.) I'm not sure if breaking the existing API is worth the trouble. We could just change the documentation of ‘affixation-function’ to define only one supported way of using the “completion + prefix + suffix” format to reduce confusion. >> More than three elements are already supported since e.g. the >> total length is calculated as a sum of lengths of all strings: >> (apply #'+ (mapcar #'string-width str)) > > I see. So all the later elements are suffixes and concatenated? This seems > like an unnecessary completion given that the completion-table implementor > can already concatenate all the suffixes. This is just implementation detail, there is no intention to support more suffixes. > Or is the idea that the UI can show all these suffixes in some kind of > table-like view? Currently I'm trying to use tabulated-list-mode in the completions buffer. But even in this case there is no need to add more suffixes for more table columns. > My proposal is to only allow three-element lists and remove support to > specify only the suffix. Supporting only the suffix still is necessary for the ‘annotation-function’. > And one could keep the door open by allowing more than three element lists > for additional annotations. Let's say you want to specify some additional > help/tool-tip text for example. I'd prefer to support additional text using keywords, e.g. ("completion" "prefix" "suffix" :help "Help text")