>>>> "Hrvoje" == Hrvoje Niksic
<hniksic(a)srce.hr> writes:
Hello Hrvoje,
your patch fixes the problem from me.
Here is the *Backtrace* for my testcase of the (make-annotation ...)
crash:
Signaling:
(wrong-type-argument buffer-glyph-p #<glyph (pointer)
#<image-specifier global=(((mswindows) . [xpm :color-symbols
(("foregroundToolBarColor" . #<color-specifier
global=<unspecified> fallback=#<color-specifier
global=<unspecified> fallback=(((mswindows) . "black")) 0x1ac>
0x1da>) ("backgroundToolBarColor" . #<color-specifier
global=<unspecified> fallback=#<color-specifier
global=<unspecified> fallback=(((mswindows) . "Gray75")) 0x1ae>
0x1dc>) ("background" . #<color-specifier global=<unspecified>
fallback=(((mswindows) . "white")) 0x197>) ("foreground"
. #<color-specifier global=<unspecified> fallback=(((mswindows)
. "black")) 0x195>)) :file "c:\\Program
Files\\XEmacs\\XEmacs-21.2-b5\\etc\\recycle.xpm" ...]) ((stream)
. [mswindows-resource :resource-type cursor :resource-id "Wait"]))
fallback=((nil . [nothing])) 0x27f>0x27e>)
set-extent-begin-glyph(#<extent [267, 267) 0x1064bb84 in buffer
gc-pointer-glyph-experiment.el> #<glyph (pointer)
#<image-specifier global=(... ...) fallback=(...) 0x27f>0x27e> text)
make-annotation(#<glyph (pointer) #<image-specifier global=(... ...)
fallback=(...) 0x27f>0x27e> nil text)
eval((make-annotation gc-pointer-glyph nil (quote text)))
eval-interactive((make-annotation gc-pointer-glyph nil (quote text)))
eval-last-sexp(nil)
call-interactively(eval-last-sexp)
The backtrace for Colin's and my testcase are identical for me except
for the different glyphs being used.
Hrvoje> Adrian, Colin, could you please confirm that this patch fixes the
Hrvoje> problem? The patch disallows attaching glyphs to extents unless
Hrvoje> glyphs are of type `buffer', which prevents the crash for me.
Confirmed!
Thanks for the patch.
Adrian
Hrvoje> It might still be possible to muck things up by attaching an empty
Hrvoje> `buffer' glyph to an extent, and then attaching a, say, `pointer'
Hrvoje> image instance object to the glyph, but I was unable to prove it.
Hrvoje> 1998-12-14 Hrvoje Niksic <hniksic(a)srce.hr>
Hrvoje> * extents.c (set_extent_glyph_1): Make sure that the glyph we
Hrvoje> attach to the extent is valid.
Hrvoje> --- src/extents.c.orig Mon Dec 14 23:08:54 1998
Hrvoje> +++ src/extents.c Mon Dec 14 23:17:45 1998
Hrvoje> @@ -5009,10 +5009,10 @@
Hrvoje> EXTENT extent = decode_extent (extent_obj, DE_MUST_HAVE_BUFFER);
Hrvoje> glyph_layout layout = symbol_to_glyph_layout (layout_obj);
Hrvoje> - /* Make sure we've actually been given a glyph or it's nil
(meaning
Hrvoje> - we're deleting a glyph from an extent). */
Hrvoje> + /* Make sure we've actually been given a valid glyph or it's
nil
Hrvoje> + (meaning we're deleting a glyph from an extent). */
Hrvoje> if (!NILP (glyph))
Hrvoje> - CHECK_GLYPH (glyph);
Hrvoje> + CHECK_BUFFER_GLYPH (glyph);
Hrvoje> set_extent_glyph (extent, glyph, endp, layout);
Hrvoje> return glyph;