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: Inline completion preview Date: Wed, 1 Nov 2023 11:07:21 +0000 Message-ID: References: <2c15c71f-613d-ec61-774d-93e7696470eb@gutov.dev> <8ec6cab5d8104227fef6123b9c99f93a@condition-alpha.com> <8af5efc7-754a-111d-42d7-b875edbb6202@gutov.dev> <26ef9d21-9ab6-1cf5-005d-4ad2907169b5@gutov.dev> 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="18193"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dmitry Gutov , Alexander Adolf , Juri Linkov , Eli Zaretskii , emacs-devel@gnu.org To: Eshel Yaron Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 01 12:08:27 2023 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 1qy95H-0004UL-9A for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Nov 2023 12:08:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qy94f-0003Do-IH; Wed, 01 Nov 2023 07:07:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qy94Z-0003D5-TO for emacs-devel@gnu.org; Wed, 01 Nov 2023 07:07:44 -0400 Original-Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qy94S-00044R-Ru; Wed, 01 Nov 2023 07:07:38 -0400 Original-Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-507d7b73b74so8994642e87.3; Wed, 01 Nov 2023 04:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698836854; x=1699441654; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=G7lOVreEvDGSLqxQiaVJRlA3SMfrnj5KDIqcqEY6wgw=; b=WOogn65Lm4A5fvITm52vOU7TfIvEcz+y8EzV2tJ4ise1MK9Yt0b/DmDtn4jljHl05C tHaMWFhu1NdQ/+ckZ+L9lvVBe8y1fiCMzuXF6y3DXhReCzvEIIpcxAmW8eBw31bHRTA0 OT1ZWuR4V215Ahl2r9N3ZyQRcIMZ+bq0RJtpdEdnDgZcQs/ppopiQ2g3uEWQBK7PLNH4 iwb3Atw6Xg/P71mkdEG8fNYJ5vE1uVripX2LI6kRORbBLdvFrLKS5GqevAHkYCRFxB/5 c8MM1y1ik7rQjk+zf+eSkPvs/fsgwhY0zMM2KehDfcNnZN4DAtBO8xrL04nAu1WrQbQh 5IyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698836854; x=1699441654; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G7lOVreEvDGSLqxQiaVJRlA3SMfrnj5KDIqcqEY6wgw=; b=f+1qMvnM7Mo1Pzfbg8zXnfsq8A+lsjvZUCHY3bRIfDLq6UkSnQ9e5MvpA+WdU2GKAN /T3dL4lDMzL1PC//1Vvh4UG2EBCDMYPkXAuQL5mGqmFp66A3x9UX9P1fmZ0F0vo0ue9M TAmmv8jNm4PVnYG63dip5cl2EZjUovoUMp7uLEfkcub/2tyO4+ngfwkdly/oUyRIKZP5 27Pt6oS1Tt9cga0LzDr6XCXiWakPBaty7dp+i09YDbXMXyTUx2S9TMnEu85SwHt4mLjq xWA78sm3MwcYAMAFgOHxv2DVoMYlkw117F5e224l2pTumDRrqmBnoVUCiOPZ1fMX/R9A 6Iwg== X-Gm-Message-State: AOJu0YwnBTiYTPbqVtuEDJYqf+Ggf7TQj/wsheWpMQfG/taDxM7mpAih HhiC7bzZz2YCo1Wzta5jIMymVFj22DUdzwGXYbY= X-Google-Smtp-Source: AGHT+IG84Is4uTauViVrxyNjMO2PsmpjG88rrE9WuPxk/s+sn7s4W9XBQbLfO+ldnkuvGJ1CvEAa3GqDorxspQAWTGk= X-Received: by 2002:ac2:5e6c:0:b0:503:905:c5a3 with SMTP id a12-20020ac25e6c000000b005030905c5a3mr9931011lfr.35.1698836853502; Wed, 01 Nov 2023 04:07:33 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::12c; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x12c.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:312048 Archived-At: On Wed, Nov 1, 2023 at 10:44=E2=80=AFAM Eshel Yaron wro= te: > > But OTOH there are other better ways to do that, i.e. via > > completion-at-point-functions. Are you sure your completion frontend > > can't work via those? The function you add to that variable could > > just endeavour to check if there's any preview showing as an overlay, > > and it if is insert it. Then you would need no rebinding. > > Yes, that could be quite a nice solution. I'll try working it in and > see how it goes. Thanks for this suggestion. Glad it helps. If you do this and it works out, then I think it's a good addition to core Emacs. Not as great as a fully fledged completion tooltip but nice nonetheless. > > Also are you 100% sure Company doesn't do this? I'm pretty sure > > it does this when there is only one completion, at least. > > No, I'm sure Company does do more or less this. As you say, and as I > mentioned upthread, Company provides a preview frontend that kicks in > when there's just one completion candidate by default. (This is in > contrast with `corfu`, that provides no such preview.) There are some > differences between my implementation and what you get with Company's > preview frontend, but if Company would make it to core Emacs that would > indeed mostly obviate the need for my `completion-preview`, at least as > far as I'm concerned. Is there a viable path for upstreaming Company? I've suggested this in the past, and it's mostly for Dmitry to answer, but IMO that path should definitely contain a scaling back of Company's company-backends infrastructure, basically importing only company-capf, which is (IME of course) the only real backend we should focus on. This would help sanitize some of the incorrect perceptions of complexity in Company setup (the kind that Alex's argument suffers from). Jo=C3=A3o