emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feature/icomplete-vertical


From: João Távora
Subject: Re: feature/icomplete-vertical
Date: Mon, 05 Oct 2020 14:07:05 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: João Távora <joaotavora@gmail.com>
>> 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.

I think the easiest way to make this function is to give it a buffer
where text exists as buffer text and truncate-lines is what it it.  Then
it can say exactly where it _would_ cut off.  The application can then
use that data to inform the display of text and/or overlay strings, and
potentially remove "semantic elements" accordingly.

João




reply via email to

[Prev in Thread] Current Thread [Next in Thread]