Tags: patch The internal Imenu function for creating an Imenu index uses markers by default, but the marker insertion type is left at the default type which does not advance the marker position when additional characters are inserted at the marker position. Attached is a patch which sets the marker insertion type to advance the marker position in the same scenario. This change means that the Imenu index will continue to be valid instead of the marker becoming desynced from the buffer contents, i.e. jumping to an index position and inserting characters will keep the marker in the correct place. I can't think of a situation where the previous marker behaviour was intentional, but it is likely that the issue wouldn't be seen by anyone who sets imenu-auto-rescan to t or in modes which do not use both imenu-prev-index-position-function and imenu-extract-index-name-function to create the Imenu index. I've assumed this would go on the master branch. Thanks, Morgan In GNU Emacs 30.0.93 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars) of 2024-12-20 built on inspiron System Description: Debian GNU/Linux 12 (bookworm) Configured using: 'configure --with-native-compilation=aot --with-xml2 --with-x-toolkit=lucid --with-tree-sitter'