From 814ace3cda2c793a1d772f64c200d1f533cc94e5 Mon Sep 17 00:00:00 2001 From: Morgan Willcock Date: Tue, 24 Dec 2024 21:39:43 +0000 Subject: [PATCH] Set marker insertion type for Imenu markers * lisp/imenu.el (imenu-default-create-index-function): Configure Imenu markers to advance their position when text is inserted at the marker position. --- lisp/imenu.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/imenu.el b/lisp/imenu.el index ba1ba5fcd00..0c6a7080e17 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -583,7 +583,11 @@ imenu-default-create-index-function (and (stringp name) ;; [ydi] Updated for imenu-use-markers. (push (cons name - (if imenu-use-markers (point-marker) (point))) + (if imenu-use-markers + (let ((marker (point-marker))) + (set-marker-insertion-type marker t) + marker) + (point))) index-alist))) index-alist)) ;; Use generic expression if possible. -- 2.39.5