Is it possible to make imenu refresh on every access, and to remove the *Rescan* item from the menu?

• Variable imenu-auto-rescan: "Non-nil means Imenu should always rescan the buffers." I do not know if that resolves the *Rescan* from appearing in the list and will not be testing that aspect/feature this evening, sorry. – lawlist Feb 13 '18 at 4:59
• Checked the code, seems there is no option not to add the rescan menu item. – ideasman42 Feb 13 '18 at 5:04

This makes the rescan item an empty string, maybe that's good enough.

(setq imenu-auto-rescan t


Here's some advice on some internal imenu functions that actually removes the rescan item. I think I got the corner cases, but it might break in the future.

(defun jpk/imenu-no-rescan-item (ret)