From 30fa6da5529f80df25fcba49d10cd8a806774868 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 12 May 2022 04:24:32 +0200 Subject: [PATCH] Add new command 'imenu-flush-cache' * lisp/imenu.el (imenu-flush-cache): New command (bug#20589). --- etc/NEWS | 7 ++++++- lisp/imenu.el | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 672260ca82b..cf2ae19ce73 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -660,8 +660,13 @@ Rcirc will use the default 'completion-at-point' mechanism. The conventional IRC behaviour of completing by cycling through the available options can be restored by enabling this option. +** imenu + +++ -** 'imenu' is now bound to 'M-g i' globally. +*** 'imenu' is now bound to 'M-g i' globally. + +--- +*** New command 'imenu-flush-cache'. * Editing Changes in Emacs 29.1 diff --git a/lisp/imenu.el b/lisp/imenu.el index a87860f0065..e452b1bb8b9 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -899,6 +899,12 @@ for more information." (`(,name . ,pos) (imenu (list name pos imenu-default-goto-function))) (_ (error "Unknown imenu item: %S" index-item))))) +(defun imenu-flush-cache () + "Flush the current imenu cache." + (interactive) + (setq imenu--index-alist nil) + (message "Flushed the imenu cache")) + (provide 'imenu) ;;; imenu.el ends here -- 2.39.2