together.)
@findex imenu
- If you type @kbd{M-g i}, it reads the name of a definition using the
-minibuffer, then moves point to that definition. You can use
-completion to specify the name; the command always displays the whole
-list of valid names.
+ If you type @kbd{M-g i} (@code{imenu}), it reads the name of a
+definition using the minibuffer, then moves point to that definition.
+You can use completion to specify the name; the command always
+displays the whole list of valid names.
@findex imenu-add-menubar-index
Alternatively, you can bind the command @code{imenu} to a mouse
than @code{imenu-auto-rescan-maxout} in bytes, and scanning is
stopped if it takes more than @code{imenu-max-index-time} seconds.
+@findex imenu-flush-cache
+ You can force Imenu to forget the buffer's index with @w{@kbd{M-x
+imenu-flush-cache @key{RET}}}. This causes Imenu to rescan the
+current buffer next time you invoke @kbd{M-g i} in that buffer.
+
@vindex imenu-sort-function
You can customize the way the menus are sorted by setting the
variable @code{imenu-sort-function}. By default, names are ordered as
---
*** New command 'imenu-flush-cache'.
+Use it if you want Imenu to forget the buffer's index alist and
+recreate it anew next time 'imenu' is invoked.
* Editing Changes in Emacs 29.1
(_ (error "Unknown imenu item: %S" index-item)))))
(defun imenu-flush-cache ()
- "Flush the current imenu cache."
+ "Flush the current imenu cache.
+This forces a full rescan of the buffer to recreate the index alist
+next time `imenu' is invoked."
(interactive)
(setq imenu--index-alist nil)
(message "Flushed the imenu cache"))