all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: contovob@tcd.ie, 41626@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <CAOqdjBfs+pTkeC5yKp=4H8t+jgRBgH0M3HRNt3pKEu0snB9poQ@mail.gmail.com> (raw)
In-Reply-To: <838sh8kv5d.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 621 bytes --]

On Sun, May 31, 2020 at 2:59 PM Eli Zaretskii <eliz@gnu.org> wrote:
> > From: Pip Cet <pipcet@gmail.com>
> > Date: Sun, 31 May 2020 13:10:47 +0000
> > Cc: 41626@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?

[-- Attachment #2: 0001-Avoid-losing-composition-state-in-handle_stop_backwa.patch --]
[-- Type: text/x-patch, Size: 1143 bytes --]

From 01fe1722036e6cbbf428e2068a666c36d718c74e Mon Sep 17 00:00:00 2001
From: Pip Cet <pipcet@gmail.com>
Date: Sun, 31 May 2020 16:58:19 +0000
Subject: [PATCH] Avoid losing composition state in handle_stop_backwards

* src/xdisp.c (handle_stop_backwards): Save composition iterator state
across our forward scan.
---
 src/xdisp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/xdisp.c b/src/xdisp.c
index ea28395cf5..e93b0bc201 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -8692,6 +8692,7 @@ handle_stop_backwards (struct it *it, ptrdiff_t charpos)
   ptrdiff_t where_we_are = (bufp ? IT_CHARPOS (*it) : IT_STRING_CHARPOS (*it));
   struct display_pos save_current = it->current;
   struct text_pos save_position = it->position;
+  struct composition_it save_cmp_it = it->cmp_it;
   struct text_pos pos1;
   ptrdiff_t next_stop;
 
@@ -8719,6 +8720,7 @@ handle_stop_backwards (struct it *it, ptrdiff_t charpos)
   it->bidi_p = true;
   it->current = save_current;
   it->position = save_position;
+  it->cmp_it = save_cmp_it;
   next_stop = it->stop_charpos;
   it->stop_charpos = it->prev_stop;
   handle_stop (it);
-- 
2.27.0.rc0


  reply	other threads:[~2020-05-31 17:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-31 10:02 bug#41626: 28.0.50; activating mark breaks RTL shaping in etc/HELLO (auto-composition-mode) Pip Cet
2020-05-31 12:40 ` Basil L. Contovounesios
2020-05-31 13:10   ` Pip Cet
2020-05-31 14:59     ` Eli Zaretskii
2020-05-31 17:08       ` Pip Cet [this message]
2020-05-31 17:30         ` Eli Zaretskii
2020-05-31 17:35           ` Eli Zaretskii
2020-06-03  7:31             ` Pip Cet
2020-05-31 14:46 ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOqdjBfs+pTkeC5yKp=4H8t+jgRBgH0M3HRNt3pKEu0snB9poQ@mail.gmail.com' \
    --to=pipcet@gmail.com \
    --cc=41626@debbugs.gnu.org \
    --cc=contovob@tcd.ie \
    --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 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.