>>>> "David" == David Kastrup
Oops, I noticed this before, but forgot to mention it.
David> Then in the LaTeX-mode-hook, the following gets called
David> (about which I happen to be entirely clueless).
(let ((tb (cdadar (or (specifier-spec-list default-toolbar (current-buffer))
(specifier-spec-list default-toolbar 'global)))))
(unless (assq preview-icon-toolbar-button tb)
Use `member', not `assq'. `memq' probably works, too, but toolbars
are short, the buttons are short and shallow, and this code gets
called rarely (ie, approximately once per LaTeX file). I suggest not
worrying about efficiency.
(append tb (list preview-icon-toolbar-button))
That should fix your doubled button problem. I don't understand why
that code would get called more than once (that might be a bug in
XEmacs), but it's the only hypothesis I can see a fix for offhand.
David> Now there is one smaller problem: the glyph is generated
David> from a PNG file with transparent colors. Displayed in the
David> text, the transparent color is the text background color.
David> Displayed in the toolbar, the transparent color is black
David> instead of the toolbar color.
(make-face 'toolbar-face "Compatibility toolbar face for XEmacs < 21.5.
Use this face for glyphs used as button icons. Does not affect the
toolbar itself (toolbars get faces in 21.5), and may not affect some
types of glyphs (\"text\" glyphs seem to get the default face; XPMs and
xface glyphs get the right face).
Probably the only property that matters is the background color.")
(set-glyph-face (car (aref preview-icon-toolbar-button 0)) 'toolbar-face)
in the initialization of preview-latex. (This should also work on the
fly if you happen to have a toolbar with the ugly PNG displayed.)
All untested, of course.
Institute of Policy and Planning Sciences http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.