Variable: imenu-create-index-function

The function to use for creating an index alist of the current buffer.

It should be a function that takes no arguments and returns
an index alist of the current buffer. The function is
called within a `save-excursion'.

See `imenu--index-alist' for the format of the buffer index alist.