all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Julian Rohrhuber via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 47360@debbugs.gnu.org
Subject: bug#47360: 27.1; using 'bar cursor, mouseclick is rounded to the wrong char position
Date: Wed, 24 Mar 2021 17:38:41 +0000	[thread overview]
Message-ID: <C1F20129-B4B7-4E8F-B48E-4D5F648E5714@protonmail.com> (raw)
In-Reply-To: <83pmzojwgg.fsf@gnu.org>



> On 24. Mar 2021, at 18:25, Eli Zaretskii <eliz@gnu.org> wrote:
>
>>
>> Date: Wed, 24 Mar 2021 07:42:28 +0000
>> From:  Julian Rohrhuber via "Bug reports for GNU Emacs,
>> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>
>> When using 'bar as cursor, the click location is truncated to the value before the character one clicks on (as expected when using a 'box). When using a 'bar, however, one expects that the "hill" is in the center of each character, and the valley between them. I've made an illustration, where the green color shows the watershed, so to speak.
>>
>> This behavior feels subtly broken.
>>
>> A solution to the issue has been suggested https://emacs.stackexchange.com/questions/20279/mouse-pointer-between-characters-and-the-text-cursor-misplacement
>>
>> Using the modified function posn-set-point below fixes the issue for me. I find the behavior also reasonable for 'box, but that might be a matter of discussion.
>
> I don't think I see the problem you describe.  If I click exactly on
> the bar cursor, the cursor doesn't move, as I'd expect.

Sorry, I may not have described the issue well.

When clicking into a text, at a random position, the  position where the cursor jumps to is calculated. Now this is a bit subtle: when you click on a character, does the cursor jump to the left of that character or to its right?

When in box mode, it jumps to the left, and here this is correct.

But when in bar mode, it should jump to the right when the click is right of the middle of the character, and only left when to its left of the middle.

Instead, it also jumps to the left.

> In any case, please note that in Emacs the bar cursor is never exactly
> between two characters, it is at the left side of a character cell, so
> closer to the character on the right (for left-to-right text).

That is completely fine, what matters is only how the right-vs-left is calculated.














  reply	other threads:[~2021-03-24 17:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24  7:42 bug#47360: 27.1; using 'bar cursor, mouseclick is rounded to the wrong char position Julian Rohrhuber via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-24 17:25 ` Eli Zaretskii
2021-03-24 17:38   ` Julian Rohrhuber via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-03-24 18:25     ` Eli Zaretskii
2021-03-24 18:39     ` Lars Ingebrigtsen
2021-03-24 19:08       ` Julian Rohrhuber via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-27 17:53         ` Julian Rohrhuber via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-27 19:47           ` Eli Zaretskii
2021-03-28  7:15             ` Julian Rohrhuber via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-28  7:25               ` Eli Zaretskii
2021-03-28 13:00                 ` Julian Rohrhuber via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=C1F20129-B4B7-4E8F-B48E-4D5F648E5714@protonmail.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=47360@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=rohrhuber@protonmail.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 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.