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:00:42 +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 11:52:59 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> That's odd, I've been C-x C-f'ing to directories with "a lot" of files
> >> and I don't notice any problems.  What size of "lot" did you have in
> >> mind?
> >
> > More than can be displayed, one candidate on each line, by the frame's
> > dimensions, I guess.
> 
> I've certainly got more than that, and the problem doesn't happen.

Then either you truncate the candidate's (i.e., don't show all of it),
or your code isn't working properly.

> > The code which displays the min-window is more-or-less the generic
> > Emacs window-display code, it doesn't care that not all of the stuff
> > fits in the window.
> 
> That's the code that honours max-mini-window-height, right?

Yes.  Followed by the normal window redisplay.

> Though that doesn't seem to be what's kicking in here, I believe it
> should be.

Not sure I can parse this properly.  What exactly isn't "kicking in"?

> Anyway, I think it's reasonable to suggest I think, that whoever is
> truncating the display has someway of notifying the client (whoever
> requested the display), that truncation happened, or is about to happen.

I think whoever truncates the display is the same as the client.
Unless I misunderstand what you mean by "truncate".

> > If an application wants to fit the buffer in the window, or display
> > some hint about truncation, it's the application's business to do
> > these things.
> 
> I guess you can argue that, but this implies there are ways to predict
> truncation (since being notified of it seems to be what you're opposed
> to).

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.

> So how is the application to know if its n lines, of lengths L = {l1,
> ..., li, ..., ln}, it wants to display (not necessarily by buffer
> insertion) in the mini-window need truncation and starting in which
> line?

We have window-text-pixel-size for that.

> Does it need to perform calculations with max-mini-window-height?

Yes.

> If so, is there a "canonical" way to perform these calculations that
> accounts for fontsizes, frame widths, etc?  To be clear, I find this
> information useful for other domais, notably designing the way the Eldoc
> should show information in the echo area.

Not sure what should be canonical here.  AFAIU, just using
window-text-pixel-size and comparing with the window dimensions is all
that's needed.



reply via email to

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