GNU bug report logs - #12403
24.2; scroll-margin breaks emacs24

Previous Next

Package: emacs;

Reported by: Yuri D'Elia <wavexx <at> thregr.org>

Date: Mon, 10 Sep 2012 15:57:02 UTC

Severity: normal

Found in version 24.2

Done: Eli Zaretskii <eliz <at> gnu.org>

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 12403 in the body.
You can then email your comments to 12403 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#12403; Package emacs. (Mon, 10 Sep 2012 15:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yuri D'Elia <wavexx <at> thregr.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 10 Sep 2012 15:57:02 GMT) Full text and rfc822 format available.

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

From: Yuri D'Elia <wavexx <at> thregr.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2; scroll-margin breaks emacs24
Date: Mon, 10 Sep 2012 16:50:22 +0200
emacs24 as shipped by debian breaks "scroll-margin".

  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=681991

It seems that setting scroll-margin on *any* value breaks the redisplay
while scrolling.

Try with the following (under a graphical session):

emacs -q

open the tutorial, scroll with the arrow keys until you reach the bottom.
Everything looks ok.

kill emacs. Start again, this time:

C-x set-variable scroll-margin 5

open the tutorial, scroll down with the arrow keys until you reach 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).


In GNU Emacs 24.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.10)
 of 2012-09-09 on trouble, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11203902
Configured using:
 `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var/lib' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'

'--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.2/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars'
 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: C
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Loading /etc/emacs/site-start.d/50php-elisp.el (source)...done
Loading /etc/emacs/site-start.d/50psvn.el (source)...done
Loading /etc/emacs/site-start.d/50pymacs.el (source)...done
Loading /etc/emacs/site-start.d/50python-docutils.el (source)...done
Loading /etc/emacs/site-start.d/50python-mode.el (source)...done
Loading /etc/emacs/site-start.d/50w3m-el.el (source)...done
Loading /etc/emacs/site-start.d/50yaml-mode.el (source)...done
Loading /etc/emacs/site-start.d/51debian-el.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...

Load-path shadows:
/usr/share/emacs/24.2/site-lisp/cmake-data/cmake-mode hides 
/usr/share/emacs/site-lisp/cmake-mode
/usr/share/emacs24/site-lisp/dictionaries-common/ispell hides 
/usr/share/emacs/24.2/lisp/textmodes/ispell
/usr/share/emacs24/site-lisp/dictionaries-common/flyspell hides 
/usr/share/emacs/24.2/lisp/textmodes/flyspell
/usr/share/emacs/site-lisp/rst hides 
/usr/share/emacs/24.2/lisp/textmodes/rst

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail regexp-opt rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils help-mode easymenu view debian-el
debian-el-loaddefs w3m-load mmm-auto mmm-vars mmm-compat cl
emacs-goodies-el emacs-goodies-custom emacs-goodies-loaddefs easy-mmode
time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
tool-bar dnd fontset image fringe lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote
make-network-process dbusbind dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12403; Package emacs. (Mon, 10 Sep 2012 16:41:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuri D'Elia <wavexx <at> thregr.org>
Cc: 12403 <at> debbugs.gnu.org
Subject: Re: bug#12403: 24.2; scroll-margin breaks emacs24
Date: Mon, 10 Sep 2012 19:39:41 +0300
> Date: Mon, 10 Sep 2012 16:50:22 +0200
> From: Yuri D'Elia <wavexx <at> thregr.org>
> 
> emacs24 as shipped by debian breaks "scroll-margin".
> 
>    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=681991
> 
> It seems that setting scroll-margin on *any* value breaks the redisplay
> while scrolling.
> 
> Try with the following (under a graphical session):
> 
> emacs -q
> 
> open the tutorial, scroll with the arrow keys until you reach the bottom.
> Everything looks ok.
> 
> kill emacs. Start again, this time:
> 
> C-x set-variable scroll-margin 5
> 
> open the tutorial, scroll down with the arrow keys until you reach 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).

Confirmed :-(.  However, this bug was present even in the first
pretest of Emacs 24, 24.0.90.

I will take a look.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Wed, 12 Sep 2012 17:16:02 GMT) Full text and rfc822 format available.

Notification sent to Yuri D'Elia <wavexx <at> thregr.org>:
bug acknowledged by developer. (Wed, 12 Sep 2012 17:16:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: wavexx <at> thregr.org
Cc: 12403-done <at> debbugs.gnu.org
Subject: Re: bug#12403: 24.2; scroll-margin breaks emacs24
Date: Wed, 12 Sep 2012 20:15:03 +0300
> Date: Mon, 10 Sep 2012 19:39:41 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 12403 <at> debbugs.gnu.org
> 
> > Try with the following (under a graphical session):
> > 
> > emacs -q
> > 
> > open the tutorial, scroll with the arrow keys until you reach the bottom.
> > Everything looks ok.
> > 
> > kill emacs. Start again, this time:
> > 
> > C-x set-variable scroll-margin 5
> > 
> > open the tutorial, scroll down with the arrow keys until you reach 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).
> 
> Confirmed :-(.  However, this bug was present even in the first
> pretest of Emacs 24, 24.0.90.
> 
> I will take a look.

Fixed in revision 108138 on the emacs-24 branch, with the following
patch:

=== modified file 'src/ChangeLog'
--- src/ChangeLog	2012-09-12 14:59:56 +0000
+++ src/ChangeLog	2012-09-12 17:10:02 +0000
@@ -1,3 +1,11 @@
+2012-09-12  Eli Zaretskii  <eliz <at> gnu.org>
+
+	* xdisp.c (try_window_reusing_current_matrix): Under bidi
+	reordering, locate the cursor by calling set_cursor_from_row; if
+	that fails, clear the desired glyph matrix before returning a
+	failure indication to the caller.  Fixes leaving garbled display
+	when fast scrolling with a down-key.  (Bug#12403)
+
 2012-09-12  Jan Djärv  <jan.h.d <at> swipnet.se>
 
 	* gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it

=== modified file 'src/xdisp.c'
--- src/xdisp.c	2012-05-30 18:09:17 +0000
+++ src/xdisp.c	2012-09-12 16:58:45 +0000
@@ -16593,28 +16593,33 @@ try_window_reusing_current_matrix (struc
 	    }
 	  if (row < bottom_row)
 	    {
-	      struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos;
-	      struct glyph *end = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA];
-
-	      /* Can't use this optimization with bidi-reordered glyph
-		 rows, unless cursor is already at point. */
+	      /* Can't simply scan the row for point with
+		 bidi-reordered glyph rows.  Let set_cursor_from_row
+		 figure out where to put the cursor, and if it fails,
+		 give up.  */
 	      if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)))
 		{
-		  if (!(w->cursor.hpos >= 0
-			&& w->cursor.hpos < row->used[TEXT_AREA]
-			&& BUFFERP (glyph->object)
-			&& glyph->charpos == PT))
-		    return 0;
+		  if (!set_cursor_from_row (w, row, w->current_matrix,
+					    0, 0, 0, 0))
+		    {
+		      clear_glyph_matrix (w->desired_matrix);
+		      return 0;
+		    }
 		}
 	      else
-		for (; glyph < end
-		       && (!BUFFERP (glyph->object)
-			   || glyph->charpos < PT);
-		     glyph++)
-		  {
-		    w->cursor.hpos++;
-		    w->cursor.x += glyph->pixel_width;
-		  }
+		{
+		  struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos;
+		  struct glyph *end = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA];
+
+		  for (; glyph < end
+			 && (!BUFFERP (glyph->object)
+			     || glyph->charpos < PT);
+		       glyph++)
+		    {
+		      w->cursor.hpos++;
+		      w->cursor.x += glyph->pixel_width;
+		    }
+		}
 	    }
 	}
 






bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 11 Oct 2012 11:24:02 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 222 days ago.

Previous Next


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