all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 20847@debbugs.gnu.org
Subject: bug#20847: [display engine] 25.0.50; company-mode popup makes point jump to an entirely different location
Date: Sun, 21 Jun 2015 20:46:59 +0300	[thread overview]
Message-ID: <5586F893.2070504@yandex.ru> (raw)
In-Reply-To: <83ioahhvwk.fsf@gnu.org>

On 06/21/2015 07:24 PM, Eli Zaretskii wrote:

> Ugh...  Why doesn't ELPA have the latest code?

Because GitHub provides certain niceties as a project (and code) hosting 
plaform. This has been discussed before. Company is not the only project 
to host on GitHub and only push releases to ELPA.

>> Which character should I put this property on in this situation, then?
>
> The one before, I think.  Like I explained later:

I see. But that's going to look confusing: if the cursor appears 
earlier, the users are going to assume (at least from time to time) that 
they haven't typed the last character yet.

That kind of confusion isn't good for a code completion framework.

> I didn't investigate why this happens.  Is it important?  Suppose I
> "fixed" it by having the cursor on the same place in the second
> paragraph where it ends up later -- will this be better in some sense?
> If so, I will look into it.  (It's probably some redisplay
> optimization that needs to be disabled in that case.)

Not really important. I just thought it might be a detail that would 
lead you to a different explanation for this bug. Same for the extra 
questions in the following email.

> Sorry, I'm not following, or maybe I don't understand the underlying
> issues.  (I've re-read that bug, but I don't think it's relevant to
> what I'm asking here.)  My question is about the newlines that get
> inserted into the overlay string.

We can't really use a different rendering approach for every distinct 
layout of the buffer text: I'll go crazy.

Originally, the overlay (usually) started after the newline, and the 
popup was rendered using an overlay spanning the next 10 lines.

Now that we've found out that the `display' text property beginning 
right after that newline can really screw things (make the display value 
appear twice), the popup overlay begins one character earlier, and 
includes that character in its display string.

If that sounds like an overlay priority war, it pretty much is; except 
one can configure overlay priorities, but they can't do that for 
`invisible' vs `display'.

> The original buffer text is one
> long line, without any newlines, which occupies several screen lines.
> Why cannot the overlay string be simply a copy of that text, a single
> long string without any newlines?  The display engine will display
> them with the continuation indicators on the fringes, exactly like it
> does for buffer text, and the user will not "lose" those characters at
> the end of each line.

Can't say I've considered this before, this sounds more complex that 
what we have now, and depends on lines being wrapped in a certain way.

First, what if visual-line-mode is on? Then we'll have to track the 
presence of it and similar modes.

Second, the continuation characters will look out of place (and we'll 
have to have them for the next 10 lines, right?). Because normally you 
don't see them, but if the overlay rendering switches to wrapped lines 
instead of newlines, they will always be present (or rather blink in and 
out of existence as the popup is displayed or hidden).

>> It also simplifies some logic in the code, because sometimes we have to
>> do this anyway (when the popup is displayed below the last line, and it
>> has no trailing newline).
>
> You have "to do" what sometimes?

Start the popup overlay at the end of the preceding line, and include a 
newline in its display string (because there's no newline in the 
buffer). Admittedly, it's a recent development; previously, Company 
inserted a temporary newline, tracked it, and removed it after 
completion. And caught its share of bugs because of that.





  reply	other threads:[~2015-06-21 17:46 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-19  1:04 bug#20847: [display engine] 25.0.50; company-mode popup makes point jump to an entirely different location Dmitry Gutov
2015-06-19 19:07 ` Eli Zaretskii
2015-06-20 11:51   ` Eli Zaretskii
2015-06-21 13:56     ` Dmitry Gutov
2015-06-21 16:43       ` Eli Zaretskii
2015-06-21 18:06         ` Dmitry Gutov
2015-06-21 18:24           ` Eli Zaretskii
2015-06-21 19:23             ` Eli Zaretskii
2015-06-21 20:17               ` Dmitry Gutov
2015-06-21 20:02             ` Dmitry Gutov
2015-06-22  2:45               ` Eli Zaretskii
2015-06-22 11:01                 ` Dmitry Gutov
2015-06-22 13:40                 ` Dmitry Gutov
2015-06-22 16:26                   ` Eli Zaretskii
2015-06-22 21:06                     ` Dmitry Gutov
2015-06-23 16:39                       ` Eli Zaretskii
2015-06-23 18:44                         ` Dmitry Gutov
2015-06-23 19:07                           ` Eli Zaretskii
2015-06-23 21:15                             ` Dmitry Gutov
2015-06-24 16:18                               ` Eli Zaretskii
2015-06-29 15:48                                 ` Dmitry Gutov
2015-06-30 17:46                                   ` Eli Zaretskii
2015-06-30 19:41                                     ` Dmitry Gutov
2015-06-30 20:11                                       ` Eli Zaretskii
2015-06-30 20:20                                         ` Dmitry Gutov
2015-07-01  2:42                                           ` Eli Zaretskii
2015-07-01 10:21                                             ` Dmitry Gutov
2015-07-01 15:16                                               ` Eli Zaretskii
2015-07-01 16:36                                                 ` Dmitry Gutov
2015-07-01 16:40                                                   ` Eli Zaretskii
2015-06-21 13:30   ` Dmitry Gutov
2015-06-21 14:16     ` Dmitry Gutov
2015-06-21 16:24     ` Eli Zaretskii
2015-06-21 17:46       ` Dmitry Gutov [this message]
2015-06-21 18:09         ` Eli Zaretskii
2015-06-21 20:01           ` Dmitry Gutov
2015-06-22  2:43             ` Eli Zaretskii
2015-06-22 10:57               ` Dmitry Gutov
2015-06-22 16:23                 ` Eli Zaretskii
2015-06-23  0:15                   ` 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

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

  git send-email \
    --in-reply-to=5586F893.2070504@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=20847@debbugs.gnu.org \
    --cc=eliz@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.