GNU bug report logs - #47360
27.1; using 'bar cursor, mouseclick is rounded to the wrong char position

Previous Next

Package: emacs;

Reported by: Julian Rohrhuber <rohrhuber <at> protonmail.com>

Date: Wed, 24 Mar 2021 12:52:01 UTC

Severity: normal

Found in version 27.1

Full log


Message #11 received at 47360 <at> debbugs.gnu.org (full text, mbox):

From: Julian Rohrhuber <rohrhuber <at> protonmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 47360 <at> debbugs.gnu.org
Subject: Re: bug#47360: 27.1;
 using 'bar cursor, mouseclick is rounded to the wrong char position
Date: Wed, 24 Mar 2021 17:38:41 +0000

> On 24. Mar 2021, at 18:25, Eli Zaretskii <eliz <at> 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 <at> 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.













This bug report was last modified 4 years and 121 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.