GNU bug report logs - #41626
28.0.50; activating mark breaks RTL shaping in etc/HELLO (auto-composition-mode)

Previous Next

Package: emacs;

Reported by: Pip Cet <pipcet <at> gmail.com>

Date: Sun, 31 May 2020 10:04:01 UTC

Severity: normal

Found in version 28.0.50

Done: Pip Cet <pipcet <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41626 in the body.
You can then email your comments to 41626 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#41626; Package emacs. (Sun, 31 May 2020 10:04:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pip Cet <pipcet <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 31 May 2020 10:04:01 GMT) Full text and rfc822 format available.

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

From: Pip Cet <pipcet <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; activating mark breaks RTL shaping in etc/HELLO
 (auto-composition-mode)
Date: Sun, 31 May 2020 10:02:40 +0000
[Message part 1 (text/plain, inline)]
Recipe:
start emacs -Q etc/HELLO
move point to character position 358 (ARABIC LETTER SEEN)
hit C-SPC to activate the mark

Expected result:
mark is activated, no change to shaping

Actual result:
The character at position 357 is no longer composed with the one at
position 358. (screenshot with-mark.png) whereas it was composed
before (screenshot without-mark.png)

The same thing works fine in a separate buffer in an RTL paragraph.
[without-mark.png (image/png, attachment)]
[with-mark.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41626; Package emacs. (Sun, 31 May 2020 12:42:01 GMT) Full text and rfc822 format available.

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

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Pip Cet <pipcet <at> gmail.com>
Cc: 41626 <at> debbugs.gnu.org
Subject: Re: bug#41626: 28.0.50; activating mark breaks RTL shaping in
 etc/HELLO (auto-composition-mode)
Date: Sun, 31 May 2020 13:40:57 +0100
Pip Cet <pipcet <at> gmail.com> writes:

> Recipe:
> start emacs -Q etc/HELLO
> move point to character position 358 (ARABIC LETTER SEEN)
> hit C-SPC to activate the mark
>
> Expected result:
> mark is activated, no change to shaping
>
> Actual result:
> The character at position 357 is no longer composed with the one at
> position 358. (screenshot with-mark.png) whereas it was composed
> before (screenshot without-mark.png)
>
> The same thing works fine in a separate buffer in an RTL paragraph.

FWIW, a similar thing was discussed in bug#35721.

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41626; Package emacs. (Sun, 31 May 2020 13:12:02 GMT) Full text and rfc822 format available.

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

From: Pip Cet <pipcet <at> gmail.com>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 41626 <at> debbugs.gnu.org
Subject: Re: bug#41626: 28.0.50; activating mark breaks RTL shaping in
 etc/HELLO (auto-composition-mode)
Date: Sun, 31 May 2020 13:10:47 +0000
On Sun, May 31, 2020 at 12:40 PM Basil L. Contovounesios
<contovob <at> tcd.ie> wrote:
> > The same thing works fine in a separate buffer in an RTL paragraph.
> FWIW, a similar thing was discussed in bug#35721.

Thanks for the hint!

What I don't understand is why it works in pure RTL paragraphs,
though. If I yank the Arabic greeting into a new buffer, I can place
the mark anywhere and nothing happens to the shaping.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41626; Package emacs. (Sun, 31 May 2020 14:47:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pip Cet <pipcet <at> gmail.com>
Cc: 41626 <at> debbugs.gnu.org
Subject: Re: bug#41626: 28.0.50;
 activating mark breaks RTL shaping in etc/HELLO
 (auto-composition-mode)
Date: Sun, 31 May 2020 17:46:03 +0300
> From: Pip Cet <pipcet <at> gmail.com>
> Date: Sun, 31 May 2020 10:02:40 +0000
> 
> Recipe:
> start emacs -Q etc/HELLO
> move point to character position 358 (ARABIC LETTER SEEN)
> hit C-SPC to activate the mark
> 
> Expected result:
> mark is activated, no change to shaping
> 
> Actual result:
> The character at position 357 is no longer composed with the one at
> position 358. (screenshot with-mark.png) whereas it was composed
> before (screenshot without-mark.png)
> 
> The same thing works fine in a separate buffer in an RTL paragraph.

This is a known problem with how we handle character composition and
faces when they intermix.  At the time, my conclusion was that fixing
this would be next to impossible without changing the way we handle
the "stop position" during iteration through buffer text.

Of course, I could be mistaken.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41626; Package emacs. (Sun, 31 May 2020 15:00:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pip Cet <pipcet <at> gmail.com>
Cc: contovob <at> tcd.ie, 41626 <at> debbugs.gnu.org
Subject: Re: bug#41626: 28.0.50;
 activating mark breaks RTL shaping in etc/HELLO
 (auto-composition-mode)
Date: Sun, 31 May 2020 17:59:26 +0300
> From: Pip Cet <pipcet <at> gmail.com>
> Date: Sun, 31 May 2020 13:10:47 +0000
> Cc: 41626 <at> debbugs.gnu.org
> 
> What I don't understand is why it works in pure RTL paragraphs,
> though. If I yank the Arabic greeting into a new buffer, I can place
> the mark anywhere and nothing happens to the shaping.

Because testing where the face changes while going backwards in a
buffer is "tricky".  See handle_stop_backwards and its callers.  Maybe
there's some bug in the logic there, I don't know.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41626; Package emacs. (Sun, 31 May 2020 17:10:01 GMT) Full text and rfc822 format available.

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

From: Pip Cet <pipcet <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: contovob <at> tcd.ie, 41626 <at> debbugs.gnu.org
Subject: Re: bug#41626: 28.0.50; activating mark breaks RTL shaping in
 etc/HELLO (auto-composition-mode)
Date: Sun, 31 May 2020 17:08:56 +0000
[Message part 1 (text/plain, inline)]
On Sun, May 31, 2020 at 2:59 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
> > From: Pip Cet <pipcet <at> gmail.com>
> > Date: Sun, 31 May 2020 13:10:47 +0000
> > Cc: 41626 <at> debbugs.gnu.org
> >
> > What I don't understand is why it works in pure RTL paragraphs,
> > though. If I yank the Arabic greeting into a new buffer, I can place
> > the mark anywhere and nothing happens to the shaping.
>
> Because testing where the face changes while going backwards in a
> buffer is "tricky".  See handle_stop_backwards and its callers.

Thanks!

I don't see why we need to invalidate composition state in
handle_stop_backwards.

How's this?
[0001-Avoid-losing-composition-state-in-handle_stop_backwa.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41626; Package emacs. (Sun, 31 May 2020 17:32:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pip Cet <pipcet <at> gmail.com>
Cc: contovob <at> tcd.ie, 41626 <at> debbugs.gnu.org
Subject: Re: bug#41626: 28.0.50; activating mark breaks RTL shaping in
 etc/HELLO (auto-composition-mode)
Date: Sun, 31 May 2020 20:30:48 +0300
> From: Pip Cet <pipcet <at> gmail.com>
> Date: Sun, 31 May 2020 17:08:56 +0000
> Cc: contovob <at> tcd.ie, 41626 <at> debbugs.gnu.org
> 
> I don't see why we need to invalidate composition state in
> handle_stop_backwards.
> 
> How's this?

Good catch!  Please install, and thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41626; Package emacs. (Sun, 31 May 2020 17:37:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: pipcet <at> gmail.com
Cc: contovob <at> tcd.ie, 41626 <at> debbugs.gnu.org
Subject: Re: bug#41626: 28.0.50;
 activating mark breaks RTL shaping in etc/HELLO
 (auto-composition-mode)
Date: Sun, 31 May 2020 20:35:57 +0300
> Date: Sun, 31 May 2020 20:30:48 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: contovob <at> tcd.ie, 41626 <at> debbugs.gnu.org
> 
> Good catch!  Please install, and thanks.

On master, of course.




Reply sent to Pip Cet <pipcet <at> gmail.com>:
You have taken responsibility. (Wed, 03 Jun 2020 07:32:02 GMT) Full text and rfc822 format available.

Notification sent to Pip Cet <pipcet <at> gmail.com>:
bug acknowledged by developer. (Wed, 03 Jun 2020 07:32:02 GMT) Full text and rfc822 format available.

Message #31 received at 41626-done <at> debbugs.gnu.org (full text, mbox):

From: Pip Cet <pipcet <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: contovob <at> tcd.ie, 41626-done <at> debbugs.gnu.org
Subject: Re: bug#41626: 28.0.50; activating mark breaks RTL shaping in
 etc/HELLO (auto-composition-mode)
Date: Wed, 03 Jun 2020 07:31:31 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Sun, 31 May 2020 20:30:48 +0300
>> From: Eli Zaretskii <eliz <at> gnu.org>
>> Cc: contovob <at> tcd.ie, 41626 <at> debbugs.gnu.org
>> 
>> Good catch!  Please install, and thanks.
>
> On master, of course.

Done, closing this bug. Thank you!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 01 Jul 2020 11:24:04 GMT) Full text and rfc822 format available.

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

Previous Next


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