From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <837gxp86lp.fsf@gnu.org> References: <83bon2ad9z.fsf@gnu.org> <8762dacc3w.fsf@maru.md5i.com> <831uny9ekk.fsf@gnu.org> <87ty0uasiq.fsf@maru.md5i.com> <83y5q67z7h.fsf@gnu.org> <87lim6as39.fsf@maru.md5i.com> <83d37h8e4u.fsf@gnu.org> <83aa2l8b0i.fsf@gnu.org> <838vi588ow.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1333972515 23518 80.91.229.3 (9 Apr 2012 11:55:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 9 Apr 2012 11:55:15 +0000 (UTC) Cc: 11199@debbugs.gnu.org To: mituharu@math.s.chiba-u.ac.jp, md5i@md5i.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 09 13:55:14 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SHDBi-0000XB-4R for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Apr 2012 13:55:14 +0200 Original-Received: from localhost ([::1]:36582 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHDBh-00013W-8i for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Apr 2012 07:55:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHDBe-00012x-25 for bug-gnu-emacs@gnu.org; Mon, 09 Apr 2012 07:55:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SHDBb-0003Fc-Uz for bug-gnu-emacs@gnu.org; Mon, 09 Apr 2012 07:55:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHDBb-0003FG-QT for bug-gnu-emacs@gnu.org; Mon, 09 Apr 2012 07:55:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SHDCU-0006bJ-Dd for bug-gnu-emacs@gnu.org; Mon, 09 Apr 2012 07:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Apr 2012 11:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11199 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11199-submit@debbugs.gnu.org id=B11199.133397256025365 (code B ref 11199); Mon, 09 Apr 2012 11:56:02 +0000 Original-Received: (at 11199) by debbugs.gnu.org; 9 Apr 2012 11:56:00 +0000 Original-Received: from localhost ([127.0.0.1]:46391 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SHDCR-0006b3-Ny for submit@debbugs.gnu.org; Mon, 09 Apr 2012 07:55:59 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:36491) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SHDCP-0006as-ID for 11199@debbugs.gnu.org; Mon, 09 Apr 2012 07:55:58 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M2700600NR9XN00@a-mtaout22.012.net.il> for 11199@debbugs.gnu.org; Mon, 09 Apr 2012 14:54:47 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.229.57.204]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M27004EMNR9FY91@a-mtaout22.012.net.il>; Mon, 09 Apr 2012 14:54:46 +0300 (IDT) In-reply-to: <838vi588ow.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:58635 Archived-At: > Date: Mon, 09 Apr 2012 14:07:43 +0300 > From: Eli Zaretskii > 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. */