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: feature/icomplete-vertical Date: Mon, 05 Oct 2020 12:54:52 +0100 Message-ID: <87a6x0ga5v.fsf@gmail.com> References: <20200912133311.6ujtgczj6wyclufy@Ergus> <20200920130435.heye7bk73pm252km@Ergus> <83sgbczj0i.fsf@gnu.org> <83lfh4zfml.fsf@gnu.org> <838sd4z6lz.fsf@gnu.org> <20201001164804.mqqyxtet4ttweuyv@Ergus> <83blhhdy3w.fsf@gnu.org> <87d01xghmt.fsf@gmail.com> <83sgatc8er.fsf@gnu.org> <83mu11c78j.fsf@gnu.org> <87tuv9eygk.fsf@gmail.com> <83k0w5c4yt.fsf@gnu.org> <87mu10gbjs.fsf@gmail.com> <83h7r8dhfv.fsf@gnu.org> 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="9385"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: ghe@sdf.org, spacibba@aol.com, emacs-devel@gnu.org, casouri@gmail.com, juri@linkov.net To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 05 13:57:18 2020 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 1kPP7F-0002K0-4Q for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Oct 2020 13:57:17 +0200 Original-Received: from localhost ([::1]:41790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPP7E-0000qN-6h for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Oct 2020 07:57:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPP53-0007s7-Oh for emacs-devel@gnu.org; Mon, 05 Oct 2020 07:55:01 -0400 Original-Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:36764) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPP4z-00019A-TS; Mon, 05 Oct 2020 07:55:01 -0400 Original-Received: by mail-wm1-x332.google.com with SMTP id e2so8472764wme.1; Mon, 05 Oct 2020 04:54:55 -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=uYC90ziJ7f/VxCXU1dY5bNd1l8gA5sF8nR53Gpv2p0M=; b=aP0uDD7zqlvYcLb2Jd/aPuedZg6i1284hAn6eEjmK+KPfb50GsVsUq10fTPkYz6hrl EYy9qXvtOh9tQRYLcCUxumyv2aOLMiz241nt/e7BxurIQC3nl5KLaFhqSzSi5HQ0wcKQ IaAxFFvBuRRotykhy9NcF7cm64i23SOBSaLcdEvsMCxXnV1o7ADiRHBYNwBEllGxUbKo O33IOXwTdsbPiFVP0s+6LNvg/Rduyvkxk2LliP7F2rbr77f1YdCzvDQG4ym3qe6Wa9vY 9LVGgaVpfyDXg45dQXxl93Nk77c9N/Uc6gmtWy1LSqf44LmM6RRtjyEVR4f6itJ0H/1u HhIA== 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=uYC90ziJ7f/VxCXU1dY5bNd1l8gA5sF8nR53Gpv2p0M=; b=pAWhYGjbAKxMlD7z4+Ouoh/4tzb7Y+5f78KG9M5x45AkRhuV/M0VcraflzGD3oSHFc lT7kaeEdZq/uYoVTFvZvK5mFygSeZwOQaeuZr6BU5CgsPOYXR5T7uGO0AqtL73ggo5it v2RufPU8K0ioQDpdhsXsrkngFFA5MGh2MDBAm+226FYVGR2z9LM5qHjr5r5vUhddpg2y oR5Z/Z1IG1/AFIZZYqjpLmThwdUZ1hROY0EaIvE2ZtBk8bjdGy+P0DpCbR4d6CsDAvKl W6h/sgzHxZslpDW2VxzZ3pRVP0EG7hTRuzLofVygEwAUnU93k+a9wpfBhklWdD9VrWTa fqgA== X-Gm-Message-State: AOAM533yjjwZYoC9RfdTkyOQamqMtVgr+L6GuTQTyVAZIdJKE6aF2JYv nB6o4381lw78JkJDbhhW8Pgu4+ITvTM= X-Google-Smtp-Source: ABdhPJwtvEjVRf8/yyDr7lvJdNzt8cDqOecRLixEHxwzf61pK2p+QRfrk3Ha9ocFCW0y3Is22aQP2g== X-Received: by 2002:a1c:5a86:: with SMTP id o128mr16011844wmb.129.1601898894179; Mon, 05 Oct 2020 04:54:54 -0700 (PDT) Original-Received: from krug ([89.180.147.115]) by smtp.gmail.com with ESMTPSA id m1sm4474538wmm.34.2020.10.05.04.54.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Oct 2020 04:54:53 -0700 (PDT) In-Reply-To: <83h7r8dhfv.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 05 Oct 2020 14:45:56 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=joaotavora@gmail.com; helo=mail-wm1-x332.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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:257113 Archived-At: Eli Zaretskii writes: >> Right. But is there a very large cost in implementing a mechanism of >> notification that applications can optionally subscribe to take action >> when this common thing happens to them? > > I don't think the cost is large, but someone needs to do the writing. > Emacs was never designed to display completions this way, so it's not > surprising these mechanisms weren't implemented until now. Right. Though it's not only for completion. >> This function exists to allow Lisp programs to adjust the buffer text >> so that it fits visually in WINDOW. >>=20 >> I don't know how to use the function to do this. In other words, I have >> some buffer text and I would like to know: >>=20 >> 1) If it fits in WINDOW; >> 2) If it doesn't, where is the cutoff, as a text position. > > Basically, remove lines one by one until it fits. This was the approach I took in eldoc.el, but I found it's complex. And it assumes we want to cut off at logical line positions. In a recent proposal of bug#43543 I proposed taking it out of eldoc.el (presumably to be replaced later with some more generic means). > We could write a similar function to do what you want, but please note > that such a function will not understand the semantics of the text, so > it could suggest truncating it at some place which makes no sense. > If the caller would like a smarter 'service", we will have to come up > with some method of telling the function where it makes sense to > truncate the text. Right. My idea is that a "dumb" service gives us a text position and the application, which does know the semantics of the things being displayed, decides based on that. For example, icomplete would remove the candidate where the truncation happened and replace it with an elipsis, whereas eldoc would remove the piece of documentation entirely and maybe replace it with a hint to visit the *eldoc* buffer. Jo=C3=A3o