unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Liu Hui <liuhui1610@gmail.com>
Cc: 45837@debbugs.gnu.org
Subject: bug#45837: 28.0.50; incorrect cursor position in visual-line-mode when word-wrap-by-category is t
Date: Fri, 15 Jan 2021 10:15:08 +0200	[thread overview]
Message-ID: <834kjiboqb.fsf@gnu.org> (raw)
In-Reply-To: <CAOQTW-MfV0qaKvpmruP1offiBjVyWy1QWaLcgCXZyELeGsdumA@mail.gmail.com> (message from Liu Hui on Fri, 15 Jan 2021 15:28:33 +0800)

> From: Liu Hui <liuhui1610@gmail.com>
> Date: Fri, 15 Jan 2021 15:28:33 +0800
> Cc: 45837@debbugs.gnu.org
> 
> I have tested the patch and found that the condition `(= (cdr (nth 2
> (posn-at-point))) orig-y)` was sometimes too strict. `posn-at-point`
> may give slightly different y positions for characters on the same
> line when different fonts were used (examples can be found in the
> HELLO file). If there are inline graphics (e.g. latex previews), the y
> position can also be different.

Hmm... you are right.  But that sounds like a bug in posn-at-point, I
will look into fixing it soon.

> My suggestion is `(< (abs (- (cdr (nth 2 (posn-at-point))) orig-y))
> X)`, where X could be, empirically, `(/ (line-pixel-height) 3)` or
> a customizable value.

I went with half the line height, thanks.

> The patch works well in other cases, thanks!

Thanks for testing, I've now installed the change on the master
branch.  I'm not yet closing the bug, because I want to see what can
be done about removing the tolerance in comparing values of
posn-at-point.





  reply	other threads:[~2021-01-15  8:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  2:27 bug#45837: 28.0.50; incorrect cursor position in visual-line-mode when word-wrap-by-category is t Liu Hui
2021-01-13 14:47 ` Eli Zaretskii
2021-01-14  4:51   ` Liu Hui
2021-01-14 13:51     ` Eli Zaretskii
2021-01-15  7:28       ` Liu Hui
2021-01-15  8:15         ` Eli Zaretskii [this message]
2021-01-18 17:14           ` Eli Zaretskii
2021-01-21  3:07             ` Liu Hui
2021-01-21 14:22               ` Eli Zaretskii

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=834kjiboqb.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=45837@debbugs.gnu.org \
    --cc=liuhui1610@gmail.com \
    /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).