From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: feature/icomplete-vertical Date: Mon, 05 Oct 2020 15:05:13 +0300 Message-ID: <83ft6sdgjq.fsf@gnu.org> 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> <87a6x0ga5v.fsf@gmail.com> 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="9359"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ghe@sdf.org, spacibba@aol.com, juri@linkov.net, casouri@gmail.com, emacs-devel@gnu.org To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 05 14:06:00 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 1kPPFe-0002HG-Ly for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Oct 2020 14:05:58 +0200 Original-Received: from localhost ([::1]:51880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPPFd-0005bu-Mx for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Oct 2020 08:05:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPPF0-0004xs-Hz for emacs-devel@gnu.org; Mon, 05 Oct 2020 08:05:19 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57276) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPPEz-0002eg-Lj; Mon, 05 Oct 2020 08:05:17 -0400 Original-Received: from [176.228.60.248] (port=3736 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kPPEw-0006L3-Rb; Mon, 05 Oct 2020 08:05:15 -0400 In-Reply-To: <87a6x0ga5v.fsf@gmail.com> (message from =?utf-8?B?Sm/Do28g?= =?utf-8?B?VMOhdm9yYQ==?= on Mon, 05 Oct 2020 12:54:52 +0100) 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:257116 Archived-At: > From: João Távora > Date: Mon, 05 Oct 2020 12:54:52 +0100 > Cc: ghe@sdf.org, spacibba@aol.com, emacs-devel@gnu.org, casouri@gmail.com, > juri@linkov.net > > > 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. In use cases that are not the most trivial ones, knowing what to remove could not be easy. For example, what if the part that exceeds the window dimensions comes from display or overlay string? Also, does the application tolerate partially-visible lines? So some additional information will need to be made available to the function, I think. Patches welcome.