unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: mituharu@math.s.chiba-u.ac.jp, md5i@md5i.com
Cc: 11199@debbugs.gnu.org
Subject: bug#11199: 24.0.95; killing right-to-left text at eob leads to inconsistent state
Date: Mon, 09 Apr 2012 14:52:50 +0300	[thread overview]
Message-ID: <837gxp86lp.fsf@gnu.org> (raw)
In-Reply-To: <838vi588ow.fsf@gnu.org>

> Date: Mon, 09 Apr 2012 14:07:43 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 11199@debbugs.gnu.org
> 
> Does the patch below fixes the problem?  It does not fix the root
> cause, but should work around it well enough for the release branch.
> I will install a better (but more risky) fix on the trunk.

Actually, I found a better fix that should be safe for both branch and
trunk.  Please try it, instead of the one I sent before.

> (There was nothing wrong with the end.pos values above, as long as the
> Hebrew text in the next line existed: end.pos gives the position of
> the leftmost character on display in that line, which is not
> necessarily the first character after the newline.  The problem is
> that init_to_row_end should not use row->end at all.)

Strike that last sentence, init_to_row_end is doing its job correctly.
These issues were finalized almost 2 years ago, and I succeeded to
forget all the gory details of this complexity.

Here's the patch to try:

=== modified file 'src/xdisp.c'
--- src/xdisp.c	2012-03-31 19:30:53 +0000
+++ src/xdisp.c	2012-04-09 11:46:50 +0000
@@ -16602,7 +16602,15 @@ find_last_unchanged_at_beg_row (struct w
 	     continued.  */
 	  && !(MATRIX_ROW_END_CHARPOS (row) == first_changed_pos
 	       && (row->continued_p
-		   || row->exact_window_width_line_p)))
+		   || row->exact_window_width_line_p))
+	  /* If ROW->end is beyond ZV, then ROW->end is outdated and
+	     needs to be recomputed, so don't consider this row as
+	     unchanged.  This happens when the last line was
+	     bidi-reordered and was killed immediately before this
+	     redisplay cycle.  In that case, ROW->end stores the
+	     buffer position of the first visual-order character of
+	     the next row, which is now beyond ZV.  */
+	  && CHARPOS (row->end.pos) <= ZV)
 	row_found = row;
 
       /* Stop if last visible row.  */






  reply	other threads:[~2012-04-09 11:52 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-08  2:26 bug#11199: 24.0.95; killing right-to-left text at eob leads to inconsistent state YAMAMOTO Mitsuharu
2012-04-08  7:33 ` Eli Zaretskii
2012-04-08 18:28   ` Michael Welsh Duggan
2012-04-08 18:33     ` Michael Welsh Duggan
2012-04-08 20:03     ` Eli Zaretskii
2012-04-08 20:13       ` Eli Zaretskii
2012-04-08 20:19         ` Michael Welsh Duggan
2012-04-08 20:16       ` Michael Welsh Duggan
2012-04-08 20:20         ` Eli Zaretskii
2012-04-08 20:25           ` Michael Welsh Duggan
2012-04-08 20:37             ` Eli Zaretskii
2012-04-08 20:48               ` Eli Zaretskii
2012-04-08 21:01                 ` Michael Welsh Duggan
2012-04-08 21:10                   ` Eli Zaretskii
2012-04-08 21:17                     ` Michael Welsh Duggan
2012-04-09  6:24                       ` Eli Zaretskii
2012-04-08 20:49               ` Michael Welsh Duggan
2012-04-08 21:07                 ` Eli Zaretskii
2012-04-09  8:21                   ` YAMAMOTO Mitsuharu
2012-04-09  9:32                     ` Eli Zaretskii
2012-04-09  9:10             ` Eli Zaretskii
2012-04-09  9:48               ` YAMAMOTO Mitsuharu
2012-04-09 10:17                 ` Eli Zaretskii
2012-04-09 11:07                   ` Eli Zaretskii
2012-04-09 11:52                     ` Eli Zaretskii [this message]
2012-04-09 12:18                       ` Michael Welsh Duggan
2012-04-09 12:34                         ` Eli Zaretskii
2012-04-09 23:50                           ` YAMAMOTO Mitsuharu
2012-04-10  6:27                             ` 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=837gxp86lp.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=11199@debbugs.gnu.org \
    --cc=md5i@md5i.com \
    --cc=mituharu@math.s.chiba-u.ac.jp \
    /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).