SL Baur <steve(a)xemacs.org> writes:
The function `widget-glyph-find' in wid-edit.el uses a
suboptimal
algorithm to find glyphs. It puts `widget-glyph-directory' or
(locate-data-directory "custom") at the front of a search path,
then adds `data-directory-list'. This would be fine except that it
then proceeds to search for a list of formats across the whole
search path with priority going first to .xpm, then to .gif, .png,
.jpg, and .xbm. NOTE 1: I would argue that .png should go to the
head, followed by .xpm, .gif, .jpg and .xbm.
You are right. The correct solution is to not use `locate-file'
(<whimper>), but to hand-code the loop like this:
(loop across directories
(loop across formats
... if found, exit the outer loop ...))
Current code essentially reverses the loops, which really is
suboptimal in this case.
Noting also that the `widget-glyph-cache' only caches the
basename,
not the path, it seems like all glyph names across XEmacs and Lisp
extensions must be unique. I don't believe this is a restriction we
can or should enforce.
This is no restriction -- if you request a glyph named "foo", it is
only logical that you get the same thing next time. If you use
"/foo/bar/foo.png", you'll get what you want.
--
Hrvoje Niksic <hniksic(a)srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Reporter: Mr Gandhi, what do you think of Western Civilization?
Gandhi: I think it would be a good idea.