unofficial mirror of bug-gnu-emacs@gnu.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: Tue, 30 Jun 2015 22:41:57 +0300	[thread overview]
Message-ID: <5592F105.3010307@yandex.ru> (raw)
In-Reply-To: <83fv592ioa.fsf@gnu.org>

On 06/30/2015 08:46 PM, Eli Zaretskii wrote:

> If so, does "point" here mean that buffer position of that rightmost
> character?

Let's say yes.

> In general, you compare with the value it returns, I think.  But I
> will need to think about this some more.  (The issue that bothers me
> is the width of that last character -- it could be wider than one
> column.  Also, I think the width of the next "display element", the
> one that will be displayed on the next visual line, might affect the
> issue.)

That's why I asked. Creating a yet another variation of this function 
isn't going be very fun, especially when it's hard to test automatically.

>> Why not prefer the former?
>
> Insertion point, I think.  If you type characters, they will appear on
> the next line, which is confusing.

Isn't it the same in the absence of any overlays, if point is under the 
edge of the window (and so the cursor is displayed on the margin)?

Nothing particularly confusing about that.

> It does know that, but that's all it knows.  Specifically, the last
> examined string position is recorded in the "glyph row" structure;
> when that is non-negative, we know that there's some string there.  If
> a glyph produced from the string is available, then we can also access
> the string itself, but in the case we are discussing there are no
> glyphs.

I see.

>> Maybe the decision where to put the cursor should be made earlier, then.
>
> I don't see how this is possible: you cannot place the cursor on a
> visual line before you have fully laid out that line.  And that's what
> the code does: it invokes the function that finds where to place the
> cursor immediately after layout of the line is completed.

Maybe it could be performed in two stages: on some higher level, you 
maybe adjust the value of point if it has ventured beyond the currently 
visible area.

On the lower level, when drawing glyphs, you can adjust the placement of 
cursor, but without affecting point. Admittedly, that sounds like a 
non-trivial change.

> It might be possible to record more information, though, and use that
> to make the right decisions.
>
> But once again, you wanted a solution that will work with currently
> released Emacs, so such changes are out of scope for now.

What I said is, if it's a hack, then I want a hack that will work today.

But if a "proper" solution is introduced (one that won't make the popup 
code in Company more complex overall), then I'm not above telling all 
users to either disable bidi, or upgrade to the latest Emacs.





  reply	other threads:[~2015-06-30 19:41 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 [this message]
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
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

  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=5592F105.3010307@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 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).