IKEYAMA Tomonori <tomonori(a)suiyokai.org> writes:
Jan Vroonhof <vroonhof(a)math.ethz.ch> writes:
> Mike McEwan <mike(a)lotusland.demon.co.uk> writes:
>
> > `M-x gdb' on a program. Set a breakpoint, and then give gdb an `r'
> > to run the program. Xemacs crashes when attemptimg to display the
> > source line of the breakpoint in the source window.
>
> This is the same problem Ulrich Kaage is seeing. The problem is that
> M-x gdb uses margin glyphs and Tomonori forgot to convert
> add_margin_glyph to also insert the text runes directly.
>
> Changing this is slightly nontrivial :-(
>
> Last time his mail bounced. I'll CC gim again.
Sorry. I have missed messages about this. I will fix this problem as
soon as possible.
This patch should fix the crash.
2000-04-10 IKEYAMA Tomonori <tomonori(a)suiyokai.org>
* redisplay.c (add_margin_runes): Add text image glyph
handling.
Index: redisplay.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay.c,v
retrieving revision 1.55.2.50
diff -u -r1.55.2.50 redisplay.c
--- redisplay.c 2000/04/02 14:28:59 1.55.2.50
+++ redisplay.c 2000/04/10 12:51:19
@@ -2743,6 +2743,9 @@
int elt, end;
int xpos = start;
int reverse;
+ struct window *w = XWINDOW (window);
+ struct frame *f = XFRAME (w->frame);
+ struct device *d = XDEVICE (f->device);
if ((layout == GL_WHITESPACE && side == LEFT_GLYPHS)
|| (layout == GL_INSIDE_MARGIN && side == RIGHT_GLYPHS))
@@ -2771,21 +2774,49 @@
|| (side == RIGHT_GLYPHS &&
extent_end_glyph_layout (XEXTENT (gb->extent)) == layout)))
{
- struct rune rb;
+ Lisp_Object instance =
+ glyph_image_instance (gb->glyph, window, ERROR_ME_NOT, 1);
- rb.width = gb->width;
- rb.findex = gb->findex;
- rb.xpos = xpos;
- rb.bufpos = -1;
- rb.endpos = 0;
- rb.type = RUNE_DGLYPH;
- rb.object.dglyph.glyph = gb->glyph;
- rb.object.dglyph.extent = gb->extent;
- rb.object.dglyph.xoffset = 0;
- rb.cursor_type = CURSOR_OFF;
+ if (TEXT_IMAGE_INSTANCEP (instance))
+ {
+ Lisp_Object string = XIMAGE_INSTANCE_TEXT_STRING (instance);
+ pos_data data;
+
+ xzero (data);
+ data.d = d;
+ data.window = window;
+ data.db = db;
+ data.dl = dl;
+ data.pixpos = xpos;
+ data.max_pixpos = xpos + gb->width;
+ data.cursor_type = CURSOR_OFF;
+ data.cursor_x = -1;
+ data.findex = gb->findex;
+ data.last_charset = Qunbound;
+ data.last_findex = DEFAULT_INDEX;
+ data.result_str = Qnil;
+ data.string = Qnil;
+ add_bufbyte_string_runes (&data, XSTRING_DATA (string),
+ XSTRING_LENGTH (string), 0);
+ }
+ else
+ {
+ struct rune rb;
+
+ rb.width = gb->width;
+ rb.findex = gb->findex;
+ rb.xpos = xpos;
+ rb.bufpos = -1;
+ rb.endpos = 0;
+ rb.type = RUNE_DGLYPH;
+ rb.object.dglyph.glyph = gb->glyph;
+ rb.object.dglyph.extent = gb->extent;
+ rb.object.dglyph.xoffset = 0;
+ rb.cursor_type = CURSOR_OFF;
+ Dynarr_add (db->runes, rb);
+ }
- Dynarr_add (db->runes, rb);
- xpos += rb.width;
+ xpos += gb->width;
count--;
gb->active = 0;