I think there's a problem with Imenu when a buffer has no functions in
it. I know Imenu is newly ported to XEmacs (thanks Hrvoje!) so there
may be some rough edges. Mostly it works pretty well (I've been
updating the python-mode.el support).
Here's how to reproduce. Start up a vanilla XEmacs with the menubar
on, and be sure the imenu library is loaded. Visit an empty
Emacs-Lisp buffer, and run imenu-add-to-menubar (type "IM-Elisp" at
prompt). You should now see a menu item that reads "IM-Elisp". Try
to pull this menu down and you will get an error
menu name (first element) must be a string: (nil)
This is because the imenu-create-index-function returns nil, which
triggers the second or-clause in imenu--make-index-alist, thus
eventually setting imenu--index-alist to '(nil).
In Emacs, this return value seems to tell the menu posting code (where
ever *that* is ;-) not to post a menu item. In XEmacs, however this
causes an error. I am unsure what the right thing is to return in
XEmacs, so I can't supply a fix.