bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#75072: [PATCH] Set marker insertion type for Imenu markers


From: Morgan Willcock
Subject: bug#75072: [PATCH] Set marker insertion type for Imenu markers
Date: Tue, 24 Dec 2024 22:58:08 +0000

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'

Attachment: 0001-Set-marker-insertion-type-for-Imenu-markers.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]