From 7b3767d5ed824b8a5f347bf46001917008173fe0 Mon Sep 17 00:00:00 2001 From: Morgan Willcock Date: Wed, 25 Dec 2024 09:47:42 +0000 Subject: [PATCH] Set marker insertion type for Imenu markers * lisp/imenu.el (imenu-default-create-index-function) (imenu--generic-function): Configure Imenu markers to advance their position when characters are inserted at the marker position. --- lisp/imenu.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/imenu.el b/lisp/imenu.el index ba1ba5fcd00..12bc89cb159 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -583,7 +583,9 @@ 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 + (copy-marker (point) t) + (point))) index-alist))) index-alist)) ;; Use generic expression if possible. @@ -688,7 +690,7 @@ imenu--generic-function (unless (assoc menu-title index-alist) (push (list menu-title) index-alist)) (if imenu-use-markers - (setq beg (copy-marker beg))) + (setq beg (copy-marker beg t))) (let ((item (if function (nconc (list (match-string-no-properties index) -- 2.47.1