emacs-devel
[Top][All Lists]
Advanced

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

Re: bug#9782: 24.0.90; move-to-window-line not taking header line into a


From: Eli Zaretskii
Subject: Re: bug#9782: 24.0.90; move-to-window-line not taking header line into account
Date: Tue, 07 May 2013 19:50:51 +0300

> Date: Tue, 07 May 2013 11:41:00 +0400
> From: Dmitry Gutov <address@hidden>
> CC: address@hidden
> 
> On 07.05.2013 6:54, Eli Zaretskii wrote:
> >> One might think that `move-to-window-line' is also window-relative and
> >> thus agnostic to the header line (that naturally follows if we consider
> >> the header line a part of the window).
> >
> > "Line" is a line of text, and move-to-window-line was written to go to
> > a line of text.
> 
> The question is how they're numbered. One might imagine that the 
> "zeroth" line is covered by the header, so the first one visible is 
> number one.

But you cannot move point to the header line.  And argument of zero to
move-to-window-line already has a different meaning.

> >> We still need to compare the column values to see if the click happened
> >> exactly inside the rectangle, not to the right or left of it.
> >
> > Doesn't the overlay cover the entire rectangle?
> >
> >> And in `company-select-mouse', we need the row values to find out which
> >> rectangle line was clicked (which candidate to select)
> >
> > Isn't each rectangle a different string?
> >
> 
> There's just one overlay, and it covers all of them (plus all text on 
> the sides).

Sorry, I don't understand.  Perhaps we are talking about two different
things.  Are you talking about the menu-like display of possible
completions, shown to the user to let her select one of the
candidates?  If so, how can they be a single overlay string, when they
are shown in different screen lines?  Are you also copying the buffer
text into the overlay string or something?  Otherwise I don't
understand how can you show a multi-line overlay string and still have
buffer text be seen.  What am I missing?

> Maybe what you're suggesting would be an improvement (I see 
> dropdown-list.el also does that), but the current approach works fast 
> enough, and it would have the advantage in a hypothetical situation when 
> some of the text we need to "draw on" is already rendered via `display' 
> property.

I don't see any advantages even in that situation, but maybe I'm
misunderstanding what you mean.

My suggestion is to make each completion candidate a separate display
string, then the event position list will tell you directly which
string was clicked.

> I mean fixing the row number <-> line number discrepancy from the other 
> side, by making a wrapper for `move-to-window-line', the only function 
> of the bunch that deals with line numbers. It's used in 
> `company-pseudo-tooltip-show'.

count-screen-lines also deals with line numbers.

Anyway, I think you now have the information needed to fix company.el,
and can select the implementation that you like best.



reply via email to

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