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: Simplification of `affixation-function` Date: Thu, 29 Apr 2021 05:15:39 +0300 Message-ID: References: <87y2d777r2.fsf@mail.linkov.net> <35e2e508-cd0a-b921-af96-9c12da92faf3@yandex.ru> <126afe1f-8ac5-69fc-f6af-a586bc354d03@daniel-mendler.de> <1e9bb418-9f1a-68ee-14de-e68f30f88b0a@daniel-mendler.de> <50cfaa6f-67c0-117f-41b5-10fefabee0d2@yandex.ru> <8735vbr7w3.fsf@mail.linkov.net> <35eddaa5-30fa-80db-7a29-3d171b5c09d6@yandex.ru> <87y2d2sp18.fsf@mail.linkov.net> 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="18281"; 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: Daniel Mendler , Stefan Monnier , 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 04:17: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 1lbwFD-0004eU-Q2 for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Apr 2021 04:17:35 +0200 Original-Received: from localhost ([::1]:35382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbwFC-0007mA-Ra for ged-emacs-devel@m.gmane-mx.org; Wed, 28 Apr 2021 22:17:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbwDX-000754-7y for emacs-devel@gnu.org; Wed, 28 Apr 2021 22:15:51 -0400 Original-Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:45696) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lbwDU-0006FH-Ss for emacs-devel@gnu.org; Wed, 28 Apr 2021 22:15:50 -0400 Original-Received: by mail-wr1-x432.google.com with SMTP id h4so56073140wrt.12 for ; Wed, 28 Apr 2021 19:15:44 -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=hs7r3Yfq98O0C98ZeumUAU7Uv8NmkYbdVFL0aS21kM8=; b=OZd3lNVK+OVoqAMBNK8pIQjuyJkN5ucqnxQ1OHlQzmRHW5yOXCanp3Gljx3+OPbqzz lmtec+rVQajjphBrOJpnC1ATBVRmpnNginZ7Uz+KFNGj4H77dlsYO7I5z5FaZrC03zFr AHoUS0jDpEfxJHkfNu7au+Dd02Jtv6cmpYJ6fn7B/g96Kf8JBP3Ph5YPLOdqJsCbCS8p wB2wItnbo6k6bWZwgdUVGePgsr9OMcRBtRKsAFRsGbatvUkATFv3pR4UPME4c6fcr6eO FBE6R/j7CFMT9xGRWJhl2UhoCoTSmtMy8SSFyLpKEqBQehFjAjdtaboGrV9NKdnN9LjD cXeQ== 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=hs7r3Yfq98O0C98ZeumUAU7Uv8NmkYbdVFL0aS21kM8=; b=Z55IZw9EoTGDnKWXdL+PNY0dEgimTttrdE4cZm2Q0nsB6BIeInoNx+DYhGB728vEuS lTu0gc50EEmhtgiwP+6FsiPwCpBZmvZSjcA2lpY31+wOeyHRgfmXRWNvdNj0KpK7OoBX YtREx/cXChnIRn8+2BIbmyaT/vXcwiw6pyNzlW9s7zFwSOgn9cMbVR2Cm74JWFrnEYFJ PNLpakk3GqXgqe3McPy7Zf5lLdPEVXFBsdeVkdYpiypaF/ZA2c0p9nNqx25K3KQ9Sbpa h33/vHX8wfq9MW7xd8VDOJ1GuAi7YrfNIh23bv0uJNIKW1nRsNLXetYtuT23pMgncMLQ ztcw== X-Gm-Message-State: AOAM532rQl/EL1ARCGzgq/IOqdohCrEpJsHbqaijpNX+LI6uu8294cDh Y6P22LFKcNwkfZPRoVlg9JMd8tTI97w= X-Google-Smtp-Source: ABdhPJygqzZaI067hyxCq2G9aclMJb9Osjt5y+9baJ1WWfGDD1Vz66uMiCj7D2/ycTH7UPmniwlbXw== X-Received: by 2002:a05:6000:1887:: with SMTP id a7mr2843247wri.280.1619662542933; Wed, 28 Apr 2021 19:15:42 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id h63sm1742373wmh.13.2021.04.28.19.15.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Apr 2021 19:15:42 -0700 (PDT) In-Reply-To: <87y2d2sp18.fsf@mail.linkov.net> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=raaahh@gmail.com; helo=mail-wr1-x432.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:268595 Archived-At: On 28.04.2021 22:59, Juri Linkov wrote: > I took a look at elisp--company-kind and see such code: > > :annotation-function > (lambda (str) (if (fboundp (intern-soft str)) " ")) > :company-kind #'elisp--company-kind > > There are still hard-coded letters where "f" stands for "function". You're looking at the "old" approach to that feature, using annotation-function. I couldn't just remove it here because the default completion UI doesn't know to use :company-kind (elisp--company-kind's definition is below in the same file). The approach above has worked okay-ish over the years (so it hopefully illustrates that the use of affixation-function in read-char-by-name is not essential), but has the same flaws that I already described, for the purpose of using it seriously to show icons/kinds/types in different commands and completion tables. Until now it has only been used for Elisp, and only to indicate one specific kind, so it was less of a problem.