From: Morgan Willcock Date: Wed, 25 Dec 2024 09:47:42 +0000 (+0000) Subject: Set marker insertion type for Imenu markers X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=95fb1e576675ff31d7fd118e60df82187702f648;p=emacs.git 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. (Bug#75072) (cherry picked from commit dc4b8d198bab5363e139853f656ff553dcdeeeb5) --- diff --git a/lisp/imenu.el b/lisp/imenu.el index 47fa73bc4ea..1d6e70960cb 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -550,7 +550,9 @@ The alternate method, which is the one most often used, is to call (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. @@ -655,7 +657,7 @@ depending on PATTERNS." (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)