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 16:30:25 +0300	[thread overview]
Message-ID: <5586BC71.3080608@yandex.ru> (raw)
In-Reply-To: <83mvzvjz3w.fsf@gnu.org>

On 06/19/2015 10:07 PM, Eli Zaretskii wrote:

Hi Eli,

sorry for the late reply.

>   . There's no 'cursor' property on the overlay string that Company
>     creates for its "tooltip" of completions.  Or at least I couldn't
>     find that property: I tried both "M-x describe-text-properties" and
>     looking at the overlay string in GDB -- I see no 'cursor' property,
>     certainly not on the newline that starts the string.  If indeed
>     there is such a property there, please tell how to see it.

I'm sorry, my memory of that code was unclear. `cursor' is currently 
used only under certain rare condition, but see the end of 
`company--replacement-string', where it's applied.

Even if remove the "when" condition to put it on all the time, the 
behavior doesn't change.

By the way, since we're now discussing the changes to Company code, 
let's use the master version from 
git@github.com:company-mode/company-mode.git. Thus, the scenario changes 
from installing it from ELPA, to cloning the repo, adding the dir to 
`load-path' and `(require 'company)'.

>   . In any case, you cannot put the 'cursor' property on a newline and
>     hope it to work: the newline doesn't leave any glyphs on display,
>     certainly not when the cursor is displayed on the fringe.  So the
>     display engine doesn't know you've put the 'cursor' property there.

Which character should I put this property on in this situation, then?

The other odd thing is that the cursor is displayed in the margin 
opposite the last completion (there are 2 or 3 of them), but the overlay 
is actually of fixed size (10). So the cursor margin position doesn't 
correspond to the value of point, nor either of the overlay bounds.

>   . The overlay string generated by Company in this case is
>     problematic: it puts a newline at the end of each screen line, and
>     that removes the last character of each screen line from display.
>     I don't understand why you need to insert newlines when the
>     original text lines were one long continued line.  This is a bug in
>     Company.

It's a workaround I felt forced to take for the bug#18285. Since you've 
vetoed my suggestion to prioritize `invisible' over `display', the 
natural solution is to generally start the overlay a bit earlier.

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). Although this reason is less important.

> (Any
> idea why Company's post-command-hook calls sit-for, thus forcing
> redisplay?)

The current Company master has no `sit-for' calls, but both problems are 
still there.





  parent reply	other threads:[~2015-06-21 13:30 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 [this message]
2015-06-21 14:16     ` Dmitry Gutov
2015-06-21 16:24     ` Eli Zaretskii
2015-06-21 17:46       ` Dmitry Gutov
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=5586BC71.3080608@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.