unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: bug#9782: 24.0.90; move-to-window-line not taking header line into account
Date: Tue, 07 May 2013 21:19:59 +0400	[thread overview]
Message-ID: <518937BF.1070500@yandex.ru> (raw)
In-Reply-To: <83ip2uentg.fsf@gnu.org>

On 07.05.2013 20:50, Eli Zaretskii wrote:
>> 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?

Yes. Yes, the whole lines are copied, modified in the right place and 
then shown using `before-string' overlay property (the original text is 
hidden with `invisible' -> t).

>> 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.

If some of the lines in the middle of the modified region are doing 
freaky things with `display', `before-string', etc, it complicates our 
ability to position each overlay on the right column visually 
(`current-column' only considers physical characters, the "right" column 
may turn out to be inside a `before-string' string, stuff like that).

Making one overlay spread over all those lines means we can pre-process 
all lines, only take the physical text (plus composed chars), and mostly 
disregard third-party overlays.

> 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 understood that, thank you. It would indeed allow us to skirt the row 
<-> line issue, at the cost of pervasive changes in the code.

>> 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.

Yes, but that would be fixing the discrepancy from the other side, and 
then `company--row', reimplemented using `count-screen-lines', would 
conflict with row values from mouse events, so this will only work when 
we don't need to compare them (i.e. when using multiple overlays).

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

I guess so. Thanks for the discussion!



  reply	other threads:[~2013-05-07 17:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m2hb361p8e.fsf@ibookg4-c2.pc.gwdg.de>
     [not found] ` <E1RGADD-0008JI-Ht@fencepost.gnu.org>
     [not found]   ` <m28voi1iqe.fsf@ibookg4-c2.pc.gwdg.de>
     [not found]     ` <83mxcyuw60.fsf@gnu.org>
2013-05-04 21:12       ` bug#9782: 24.0.90; move-to-window-line not taking header line into account Dmitry Gutov
2013-05-05  2:47         ` Eli Zaretskii
2013-05-05  2:59           ` Dmitry Gutov
2013-05-05 15:53             ` Eli Zaretskii
2013-05-06  3:38               ` Dmitry Gutov
2013-05-06 16:38                 ` Eli Zaretskii
2013-05-07  1:26                   ` Dmitry Gutov
2013-05-07  2:54                     ` Eli Zaretskii
2013-05-07  7:41                       ` Dmitry Gutov
2013-05-07 16:50                         ` Eli Zaretskii
2013-05-07 17:19                           ` Dmitry Gutov [this message]
2014-08-15 23:33                             ` Dmitry Gutov
2014-08-16  8:03                               ` Eli Zaretskii
2014-08-16  8:27                                 ` Dmitry Gutov
2014-08-16 11:12                                   ` Eli Zaretskii
2014-08-19  4:51                                     ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=518937BF.1070500@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).