imenu-create-index-function

imenu-create-index-function is a variable defined in `imenu.el'.
Its value is
imenu-default-create-index-function

  • Automatically becomes buffer-local when set.
  • This variable may be risky if used as a file-local variable.

Documentation:
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.