Robert Pluim writes:
I consider it a temporary local workaround, which we can discard now
I've discovered the appropriate Gnus variable. I don't think we should
install it.
OK. I'm happy to hear that. :-)
The thing is, the current code is sort-of doing the right thing:
it's
signalling an error when the gif turns out to be invalid, it's just
that the end-result of that is 293 lines of backtrace.
Hm. I just got around to trying it, and I only get 43 lines. Maybe
we should blame larsi for the other 250 lines you get? ;-)
If I could figure out a way to return something valid-but-empty from
gif_instantiate I would, but understanding is eluding me for now.
I don't think returning is the right thing to do:
Errors should never pass silently.
Unless explicitly silenced.
The obvious application of the Zen is for the calling code to do the
explicit silencing. In the case of VM,
(condition-case nil
(set-extent-begin-glyph (make-extent (point) (point))
(make-glyph (vector 'gif :data data)))
(image-conversion-error (insert "[invalid GIF: " file "]\n")))
or similar.
Also, having just tested this for other image types, the same
problem
exists in at least {jpeg, png}_instantiate as well. Perhaps we should
catch that error in make-image-instance?
Unfortunately, there are times when we do want to see such errors. It
would be horrible for somebody to spend a few days trying to track
down why some image doesn't appear, only to find out that the image is
broken (according to giflib) and got swallowed in make-image-instance.
I agree that we do *not* (normally) want to see a backtrace for a
problem that XEmacs thinks is external. `make-image-instance' seems
to agree, it has a fourth argument NOERROR with this documentation:
NOERROR controls what happens with the image cannot be generated.
If nil, an error message is generated. If t, no messages are
generated and this function returns nil. If anything else, a
warning message is generated and this function returns nil.
But callers of make-image-instance don't generally seem to have a way
to control that. :-(
It doesn't say what's in the error message. Maybe we can suppress the
backtrace part in make-image-instance.
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta