aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2022-05-12 04:24:32 +0200
committerLars Ingebrigtsen2022-05-12 04:24:32 +0200
commit30fa6da5529f80df25fcba49d10cd8a806774868 (patch)
tree217baa45632876ab565ec0e0736ab99444c48de4
parent42001f843bb7ca687bf5096543a5d478dab38b87 (diff)
downloademacs-30fa6da5529f80df25fcba49d10cd8a806774868.tar.gz
emacs-30fa6da5529f80df25fcba49d10cd8a806774868.zip
Add new command 'imenu-flush-cache'
* lisp/imenu.el (imenu-flush-cache): New command (bug#20589).
-rw-r--r--etc/NEWS7
-rw-r--r--lisp/imenu.el6
2 files changed, 12 insertions, 1 deletions
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
660conventional IRC behaviour of completing by cycling through the 660conventional IRC behaviour of completing by cycling through the
661available options can be restored by enabling this option. 661available options can be restored by enabling this option.
662 662
663** imenu
664
663+++ 665+++
664** 'imenu' is now bound to 'M-g i' globally. 666*** 'imenu' is now bound to 'M-g i' globally.
667
668---
669*** New command 'imenu-flush-cache'.
665 670
666* Editing Changes in Emacs 29.1 671* Editing Changes in Emacs 29.1
667 672
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."
899 (`(,name . ,pos) (imenu (list name pos imenu-default-goto-function))) 899 (`(,name . ,pos) (imenu (list name pos imenu-default-goto-function)))
900 (_ (error "Unknown imenu item: %S" index-item))))) 900 (_ (error "Unknown imenu item: %S" index-item)))))
901 901
902(defun imenu-flush-cache ()
903 "Flush the current imenu cache."
904 (interactive)
905 (setq imenu--index-alist nil)
906 (message "Flushed the imenu cache"))
907
902(provide 'imenu) 908(provide 'imenu)
903 909
904;;; imenu.el ends here 910;;; imenu.el ends here