emacs-devel
[Top][All Lists]
Advanced

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

Re: feature/icomplete-vertical


From: Eli Zaretskii
Subject: Re: feature/icomplete-vertical
Date: Mon, 05 Oct 2020 14:45:56 +0300

> From: João Távora <joaotavora@gmail.com>
> Cc: ghe@sdf.org,  spacibba@aol.com,  juri@linkov.net,  casouri@gmail.com,
>   emacs-devel@gnu.org
> Date: Mon, 05 Oct 2020 12:24:55 +0100
> 
> Truncation is being given something to display, such as here:
> 
>   (let ((minibuffer-setup-hook (lambda ()
>                                  (insert (format "one\ntwo\nthree\nfour")))))
>     (read-minibuffer "hey"))
> 
> and _not_ actually displaying it becasue of some window size constraint.
> 
> > There are ways.  They aren't necessarily easy, but if your application
> > does care about not everything being visible in a window, the
> > application must do something about it, because the "normal" Emacs
> > display doesn't treat partial display of a buffer as something
> > special, since that is what happens all the time in Emacs.
> 
> 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.

>    This function exists to allow Lisp programs to adjust the buffer text
>    so that it fits visually in WINDOW.
> 
> 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:
> 
> 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.

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.



reply via email to

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