diff options
| author | Eli Zaretskii | 2022-05-12 09:16:24 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2022-05-12 09:16:24 +0300 |
| commit | ba20b68d558e67fe72cb47398e4decf261c45d7a (patch) | |
| tree | 156561e21671a7d0f24b64b8de02082032cc63be | |
| parent | ec1a14ab331c0abc57bc34972a8a6f69c6ffa17a (diff) | |
| download | emacs-ba20b68d558e67fe72cb47398e4decf261c45d7a.tar.gz emacs-ba20b68d558e67fe72cb47398e4decf261c45d7a.zip | |
; Improve documentation of 'imenu-flush-cache'
* etc/NEWS: Expand the description of 'imenu-flush-cache'.
* doc/emacs/programs.texi (Imenu): Document 'imenu-flush-cache'.
* lisp/imenu.el (imenu-flush-cache): Doc fix. (Bug#20589)
| -rw-r--r-- | doc/emacs/programs.texi | 13 | ||||
| -rw-r--r-- | etc/NEWS | 2 | ||||
| -rw-r--r-- | lisp/imenu.el | 4 |
3 files changed, 14 insertions, 5 deletions
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 45bc4c79b4f..2b27d4e13c6 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi | |||
| @@ -250,10 +250,10 @@ where it treats each chapter, section, etc., as a definition. | |||
| 250 | together.) | 250 | together.) |
| 251 | 251 | ||
| 252 | @findex imenu | 252 | @findex imenu |
| 253 | If you type @kbd{M-g i}, it reads the name of a definition using the | 253 | If you type @kbd{M-g i} (@code{imenu}), it reads the name of a |
| 254 | minibuffer, then moves point to that definition. You can use | 254 | definition using the minibuffer, then moves point to that definition. |
| 255 | completion to specify the name; the command always displays the whole | 255 | You can use completion to specify the name; the command always |
| 256 | list of valid names. | 256 | displays the whole list of valid names. |
| 257 | 257 | ||
| 258 | @findex imenu-add-menubar-index | 258 | @findex imenu-add-menubar-index |
| 259 | Alternatively, you can bind the command @code{imenu} to a mouse | 259 | Alternatively, you can bind the command @code{imenu} to a mouse |
| @@ -280,6 +280,11 @@ changes in the text. | |||
| 280 | than @code{imenu-auto-rescan-maxout} in bytes, and scanning is | 280 | than @code{imenu-auto-rescan-maxout} in bytes, and scanning is |
| 281 | stopped if it takes more than @code{imenu-max-index-time} seconds. | 281 | stopped if it takes more than @code{imenu-max-index-time} seconds. |
| 282 | 282 | ||
| 283 | @findex imenu-flush-cache | ||
| 284 | You can force Imenu to forget the buffer's index with @w{@kbd{M-x | ||
| 285 | imenu-flush-cache @key{RET}}}. This causes Imenu to rescan the | ||
| 286 | current buffer next time you invoke @kbd{M-g i} in that buffer. | ||
| 287 | |||
| 283 | @vindex imenu-sort-function | 288 | @vindex imenu-sort-function |
| 284 | You can customize the way the menus are sorted by setting the | 289 | You can customize the way the menus are sorted by setting the |
| 285 | variable @code{imenu-sort-function}. By default, names are ordered as | 290 | variable @code{imenu-sort-function}. By default, names are ordered as |
| @@ -667,6 +667,8 @@ available options can be restored by enabling this option. | |||
| 667 | 667 | ||
| 668 | --- | 668 | --- |
| 669 | *** New command 'imenu-flush-cache'. | 669 | *** New command 'imenu-flush-cache'. |
| 670 | Use it if you want Imenu to forget the buffer's index alist and | ||
| 671 | recreate it anew next time 'imenu' is invoked. | ||
| 670 | 672 | ||
| 671 | * Editing Changes in Emacs 29.1 | 673 | * Editing Changes in Emacs 29.1 |
| 672 | 674 | ||
diff --git a/lisp/imenu.el b/lisp/imenu.el index e452b1bb8b9..a08c58f6825 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -900,7 +900,9 @@ for more information." | |||
| 900 | (_ (error "Unknown imenu item: %S" index-item))))) | 900 | (_ (error "Unknown imenu item: %S" index-item))))) |
| 901 | 901 | ||
| 902 | (defun imenu-flush-cache () | 902 | (defun imenu-flush-cache () |
| 903 | "Flush the current imenu cache." | 903 | "Flush the current imenu cache. |
| 904 | This forces a full rescan of the buffer to recreate the index alist | ||
| 905 | next time `imenu' is invoked." | ||
| 904 | (interactive) | 906 | (interactive) |
| 905 | (setq imenu--index-alist nil) | 907 | (setq imenu--index-alist nil) |
| 906 | (message "Flushed the imenu cache")) | 908 | (message "Flushed the imenu cache")) |