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#12403: 24.2; scroll-margin breaks emacs24 Date: Wed, 12 Sep 2012 20:15:03 +0300 Message-ID: <83bohbw4bs.fsf@gnu.org> References: <504DFE2E.7040007@thregr.org> <83har5ltma.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1347471445 32348 80.91.229.3 (12 Sep 2012 17:37:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Sep 2012 17:37:25 +0000 (UTC) Cc: 12403-done@debbugs.gnu.org To: wavexx@thregr.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 12 19:37:27 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 1TBqsP-0005qF-OO for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Sep 2012 19:37:25 +0200 Original-Received: from localhost ([::1]:41508 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBqsL-0002Bl-Vj for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Sep 2012 13:37:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBqsG-0002BY-0D for bug-gnu-emacs@gnu.org; Wed, 12 Sep 2012 13:37:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBqsA-00017g-1z for bug-gnu-emacs@gnu.org; Wed, 12 Sep 2012 13:37:15 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBqs9-00017G-Vg for bug-gnu-emacs@gnu.org; Wed, 12 Sep 2012 13:37:10 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TBqXi-00064q-Dw for bug-gnu-emacs@gnu.org; Wed, 12 Sep 2012 13:16:02 -0400 Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Sep 2012 17:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 12403 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 12403@debbugs.gnu.org, eliz@gnu.org Original-Received: via spool by 12403-done@debbugs.gnu.org id=D12403.134747015323341 (code D ref 12403); Wed, 12 Sep 2012 17:16:02 +0000 Original-Received: (at 12403-done) by debbugs.gnu.org; 12 Sep 2012 17:15:53 +0000 Original-Received: from localhost ([127.0.0.1]:57405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TBqXZ-00064P-52 for submit@debbugs.gnu.org; Wed, 12 Sep 2012 13:15:53 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:42910) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TBqXW-00064H-Ph for 12403-done@debbugs.gnu.org; Wed, 12 Sep 2012 13:15:52 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MA800100YHZRB00@a-mtaout20.012.net.il> for 12403-done@debbugs.gnu.org; Wed, 12 Sep 2012 20:14:52 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MA8000XOYKSE7P0@a-mtaout20.012.net.il>; Wed, 12 Sep 2012 20:14:52 +0300 (IDT) In-reply-to: <83har5ltma.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:64200 Archived-At: > Date: Mon, 10 Sep 2012 19:39:41 +0300 > From: Eli Zaretskii > Cc: 12403@debbugs.gnu.org >=20 > > Try with the following (under a graphical session): > >=20 > > emacs -q > >=20 > > open the tutorial, scroll with the arrow keys until you reach the= bottom. > > Everything looks ok. > >=20 > > kill emacs. Start again, this time: > >=20 > > C-x set-variable scroll-margin 5 > >=20 > > open the tutorial, scroll down with the arrow keys until you reac= h the > > bottom. Text on the page looks *badly* garbled (this is not just > > character left-overs from the previous screenfull, a lot of lines= look > > repeated at some point in the same line). >=20 > Confirmed :-(. However, this bug was present even in the first > pretest of Emacs 24, 24.0.90. >=20 > I will take a look. Fixed in revision 108138 on the emacs-24 branch, with the following patch: =3D=3D=3D modified file 'src/ChangeLog' --- src/ChangeLog=092012-09-12 14:59:56 +0000 +++ src/ChangeLog=092012-09-12 17:10:02 +0000 @@ -1,3 +1,11 @@ +2012-09-12 Eli Zaretskii + +=09* xdisp.c (try_window_reusing_current_matrix): Under bidi +=09reordering, locate the cursor by calling set_cursor_from_row; if +=09that fails, clear the desired glyph matrix before returning a +=09failure indication to the caller. Fixes leaving garbled display +=09when fast scrolling with a down-key. (Bug#12403) + 2012-09-12 Jan Dj=C3=A4rv =20 =09* gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it =3D=3D=3D modified file 'src/xdisp.c' --- src/xdisp.c=092012-05-30 18:09:17 +0000 +++ src/xdisp.c=092012-09-12 16:58:45 +0000 @@ -16593,28 +16593,33 @@ try_window_reusing_current_matrix (struc =09 } =09 if (row < bottom_row) =09 { -=09 struct glyph *glyph =3D row->glyphs[TEXT_AREA] + w->cursor.= hpos; -=09 struct glyph *end =3D row->glyphs[TEXT_AREA] + row->used[TE= XT_AREA]; - -=09 /* Can't use this optimization with bidi-reordered glyph -=09=09 rows, unless cursor is already at point. */ +=09 /* Can't simply scan the row for point with +=09=09 bidi-reordered glyph rows. Let set_cursor_from_row +=09=09 figure out where to put the cursor, and if it fails, +=09=09 give up. */ =09 if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reorderi= ng))) =09=09{ -=09=09 if (!(w->cursor.hpos >=3D 0 -=09=09=09&& w->cursor.hpos < row->used[TEXT_AREA] -=09=09=09&& BUFFERP (glyph->object) -=09=09=09&& glyph->charpos =3D=3D PT)) -=09=09 return 0; +=09=09 if (!set_cursor_from_row (w, row, w->current_matrix, +=09=09=09=09=09 0, 0, 0, 0)) +=09=09 { +=09=09 clear_glyph_matrix (w->desired_matrix); +=09=09 return 0; +=09=09 } =09=09} =09 else -=09=09for (; glyph < end -=09=09 && (!BUFFERP (glyph->object) -=09=09=09 || glyph->charpos < PT); -=09=09 glyph++) -=09=09 { -=09=09 w->cursor.hpos++; -=09=09 w->cursor.x +=3D glyph->pixel_width; -=09=09 } +=09=09{ +=09=09 struct glyph *glyph =3D row->glyphs[TEXT_AREA] + w->cursor.h= pos; +=09=09 struct glyph *end =3D row->glyphs[TEXT_AREA] + row->used[TEX= T_AREA]; + +=09=09 for (; glyph < end +=09=09=09 && (!BUFFERP (glyph->object) +=09=09=09 || glyph->charpos < PT); +=09=09 glyph++) +=09=09 { +=09=09 w->cursor.hpos++; +=09=09 w->cursor.x +=3D glyph->pixel_width; +=09=09 } +=09=09} =09 } =09} =20