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: Thu, 27 May 2021 15:19:30 +0100 Message-ID: References: <87zgwlb4xc.fsf@gmail.com> <617d06ca-27bf-2ae8-26eb-1042123499d3@daniel-mendler.de> <87pmxhb1rs.fsf@gmail.com> <23510125-37b9-e87e-3590-5322f44772ce@daniel-mendler.de> <87y2c5nhsr.fsf@mail.linkov.net> <87h7irss50.fsf@mail.linkov.net> <43d1599e-2ba9-2efb-45c3-76c67d29a69d@daniel-mendler.de> <87tumrgqrb.fsf@gmail.com> <87tumq92pe.fsf@mail.linkov.net> <87lf82g10g.fsf@gmail.com> <87y2c24lww.fsf@mail.linkov.net> <871r9t2lsy.fsf@mail.linkov.net> <187a63cb-e4d2-1012-1b51-e393692de436@yandex.ru> <0452e0e9-0764-9a0e-93d7-5a7f53b8d797@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="31347"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Daniel Mendler , "emacs-devel@gnu.org" , Stefan Monnier , Juri Linkov To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 27 16:21:15 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 1lmGst-0007xD-FY for ged-emacs-devel@m.gmane-mx.org; Thu, 27 May 2021 16:21:15 +0200 Original-Received: from localhost ([::1]:54324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmGss-0003AW-I8 for ged-emacs-devel@m.gmane-mx.org; Thu, 27 May 2021 10:21:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmGrS-0001Wg-5r for emacs-devel@gnu.org; Thu, 27 May 2021 10:19:47 -0400 Original-Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:46870) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lmGrQ-0001WO-FD for emacs-devel@gnu.org; Thu, 27 May 2021 10:19:45 -0400 Original-Received: by mail-pj1-x1036.google.com with SMTP id pi6-20020a17090b1e46b029015cec51d7cdso494966pjb.5 for ; Thu, 27 May 2021 07:19:44 -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=fqKVs8OCZGhAzhgjqxBv9f8vRaG/Ld/1I4qP+opZksg=; b=ivCMavelAy/9s+KKFCFnhduF+QFFoG2pdDIj5DXrhN5d4ABizoXVxvX38Sv3hgFB7H plI9cN/8W74aE2UeMDLmxUYobXQGprFnFMg5ZONxZq9rkdjTiuURgrjH3gAAuAyoBKFE hX9gHxegHL+Vl13UpWnaCKVCrKLbLToFu55mHt1rXnX/S+DEj0Uwvk4bqPhjFQhnxrx+ TrcSGSYsbh52z0qB0FaDElsneEmLUlCdMR1vF9BSYcSPjJlUZihDU+qcM7les/XDcO8L mI9QsgV/iHSvPPSWZrYfKypxq0i+WdL4Iv3zscE/0kSlWNhFwf+wqYGNMOzU6CGv8K6j 8g1A== 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=fqKVs8OCZGhAzhgjqxBv9f8vRaG/Ld/1I4qP+opZksg=; b=sjQ4FidaLntVqALFDoPkeCxh/E9Ere2vy+DOEsj86Izlujp/1PaZmOlUY4P39kL/Wu IJ7+mDy0gDT5athmPdlBpp+ePqyBGGXk+2xKXKLbbFuqHeJ4AysX9dZYfRnTlnH8wQ/b 2mUyQX80JpEcN/lTP/hz3iAeuHkVNjgBOOwrudjRl9XS2wb26iT6WQ0Dl4mR6uunsHNt DZJ8XhQ7ucrOXst+JpOi7en+1W+7AKopWUwg/koW2BmkaMNfrJwyjJAEX9oBzhNoiiTY e+m4r3EQVzda2Rv/1DYWUK9jUC5tfcle1hsXCkdjRDboTqKFPSee1cjejiJRPH/YXHYu lxBg== X-Gm-Message-State: AOAM532Ymyrh8cUDuKg6CvELb5HQQmT+G1daC52tVmFu6YE1vXja6rre fXxOOVlahGI4/1CRg8Aonycitm8s3U68UwAmwWU= X-Google-Smtp-Source: ABdhPJzZm6EA4QWQbzJpQsk5SdygBxNr4hlKpLcwsL6uN6OcXz4O3Oo5zmmMVIKA72hbkSS7ovsDknvSEIDt8KhHJ8s= X-Received: by 2002:a17:90a:4147:: with SMTP id m7mr9593939pjg.7.1622125182945; Thu, 27 May 2021 07:19:42 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=joaotavora@gmail.com; helo=mail-pj1-x1036.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:269946 Archived-At: On Thu, May 27, 2021 at 2:15 PM Dmitry Gutov wrote: > > On 27.05.2021 10:29, Jo=C3=A3o T=C3=A1vora wrote: > > On Thu, May 27, 2021 at 2:06 AM Dmitry Gutov wrote: > > > >>>> The downside should be obvious: you waste extra CPU and memory when = you > >>>> only need some of these values, and not all of them. > >>> I don't see why, though. Isn't the `fields` arg supposed to solve ju= st > >>> that problem? Or am I missing something? > >> OK, that was poor reading on my part (missed 'pcase'). > >> Also, the above piece of code looks awfully similar to a Company backe= nd > >> or frontend definition, which you have disparaged on multiple occasion= s. > > [ Uncalled for, right? Let's keep cool with the animosity and > > the vague accusations, stick to the topic. ] > I don't exactly mean to initiate a shouting match here. Good, then let's not bring up past ones for absolutely no reason. > I don't think this can work without doing the long-discussed migration I don't understand this. I was just suggesting that using a small variation of Juri's idea, the backend may want to use: :resolution-function #'im-backend-x-and-this-is-my-gf Instead of: :resolution-function (lambda (str field) (pcase field ...)) Then, you could easily inspect the methods of 'im-backend-x-and-this-is-my-gf' to see what fields it supports. The signature of the gf is: (defgeneric im-backend-x-and-this-is-my-gf (str field) ...) Additionally, and anticipating a possible follow-up question, to share information between different methods of the same GF (for performance reasons and only if they indeed exist) one can use a second API point that is called to let-bind special variables accessed with an argless function. I've used this pattern successfully in CLOS many times. > Yet still, even when using generic functions, why would we create an > additional dispatcher mechanism when cl-generic can already do that for > us? To reduce the number of methods in the API description? We wouldn't. I _am_ suggesting using cl-generic: I also tried to express that if we redesigned the method, instead of 'im-backend-x-and-this-is-my-gf', you could have 'this-is-the-resolution-gf= ' with a signature that takes the table (aka backend) as an argument: (defgeneric this-is-the-resolution-gf (backend field str) ...) And if backends were CLOS object you could leverage inheritance to mix and match stuff between different backends. Jo=C3=A3o