From xemacs-m  Sat Mar 22 23:48:49 1997
Received: from GS213.SP.CS.CMU.EDU (GS213.SP.CS.CMU.EDU [128.2.209.183])
	by xemacs.org (8.8.5/8.8.5) with SMTP id XAA03906
	for <xemacs-beta@xemacs.org>; Sat, 22 Mar 1997 23:48:48 -0600 (CST)
Received: by GS213.SP.CS.CMU.EDU (AIX 3.2/UCB 5.64/4.03)
          id AA43428; Sun, 23 Mar 1997 00:48:47 -0500
Date: Sun, 23 Mar 1997 00:48:47 -0500
Message-Id: <9703230548.AA43428@GS213.SP.CS.CMU.EDU>
From: Darrell Kindred <dkindred@cmu.edu>
To: xemacs-beta@xemacs.org
Subject: gdb-mode cursor bug [w/ patch]
Organization: Carnegie Mellon University School of Computer Science

I've noticed some cursor redisplay glitches that happen
on the line containing the gdb-mode "=>" arrow (a
"whitespace" glyph).  Instructions for reproducing:

    Eval this:
      (let ((b (generate-new-buffer "*test*")))
        (set-buffer b)
        (insert "      foo\n")
        (let ((e (make-extent (point-min) (point-min))))
          (set-extent-begin-glyph e (make-glyph "=>"))
          (set-extent-begin-glyph-layout e 'whitespace)
          (goto-char (point-min))
          (switch-to-buffer b)))

    Then, press M-u (uppercase-region).  The cursor at the
    beginning of the line isn't erased.  Now press C-l to
    fix that, then move to the second line, do
    reverse-isearch for "foo", and press C-a.  Cursor
    vanishes.

The patch below fixes both of these glitches.  It's not
critical, so it's probably best to just apply it to 20.1.

I've done some brief testing that suggested that the more
conservative test I inserted is rarely triggered during
typical editing operations, so the possibly-unnecessary
expense is probably not worth worrying about.

- Darrell

--- ../xemacs-19.15-b103/src/redisplay-output.c.orig	Sun Feb  2 00:07:27 1997
+++ ../xemacs-19.15-b103/src/redisplay-output.c	Sun Mar 23 00:43:08 1997
@@ -333,13 +333,23 @@
      full redraw of the block in order to make sure that the cursor is
      updated properly. */
   if (ddb->type != TEXT
+#if 0
+      /* I'm not sure exactly what this code wants to do, but it's
+       * not right--it doesn't update when cursor_elt changes from, e.g.,
+       * 0 to 8, and the new or old cursor loc overlaps this block.
+       * I've replaced it with the more conservative test below.
+       * -dkindred@cs.cmu.edu 23-Mar-1997 */
       && ((cdl->cursor_elt == -1 && ddl->cursor_elt != -1)
 	  || (cdl->cursor_elt != -1 && ddl->cursor_elt == -1))
       && (ddl->cursor_elt == -1 ||
 	  (cursor_start
 	   && cursor_width
 	   && (cursor_start + cursor_width) >= start_pixpos
-	   && cursor_start <= block_end)))
+	   && cursor_start <= block_end))
+#else
+      && (cdl->cursor_elt != ddl->cursor_elt)
+#endif
+      )
     force = 1;
 
   if (f->windows_structure_changed ||

