diff options
| author | Morgan Willcock | 2024-12-25 09:47:42 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2024-12-26 10:58:39 +0200 |
| commit | dc4b8d198bab5363e139853f656ff553dcdeeeb5 (patch) | |
| tree | 9532c857b3d115149f0d2888fe7b7978af8ab3fa | |
| parent | 6412a5503c404bbe177879d113c2299288c76ccd (diff) | |
| download | emacs-dc4b8d198bab5363e139853f656ff553dcdeeeb5.tar.gz emacs-dc4b8d198bab5363e139853f656ff553dcdeeeb5.zip | |
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)
| -rw-r--r-- | lisp/imenu.el | 6 |
1 files 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 @@ The alternate method, which is the one most often used, is to call | |||
| 583 | (and (stringp name) | 583 | (and (stringp name) |
| 584 | ;; [ydi] Updated for imenu-use-markers. | 584 | ;; [ydi] Updated for imenu-use-markers. |
| 585 | (push (cons name | 585 | (push (cons name |
| 586 | (if imenu-use-markers (point-marker) (point))) | 586 | (if imenu-use-markers |
| 587 | (copy-marker (point) t) | ||
| 588 | (point))) | ||
| 587 | index-alist))) | 589 | index-alist))) |
| 588 | index-alist)) | 590 | index-alist)) |
| 589 | ;; Use generic expression if possible. | 591 | ;; Use generic expression if possible. |
| @@ -688,7 +690,7 @@ depending on PATTERNS." | |||
| 688 | (unless (assoc menu-title index-alist) | 690 | (unless (assoc menu-title index-alist) |
| 689 | (push (list menu-title) index-alist)) | 691 | (push (list menu-title) index-alist)) |
| 690 | (if imenu-use-markers | 692 | (if imenu-use-markers |
| 691 | (setq beg (copy-marker beg))) | 693 | (setq beg (copy-marker beg t))) |
| 692 | (let ((item | 694 | (let ((item |
| 693 | (if function | 695 | (if function |
| 694 | (nconc (list (match-string-no-properties index) | 696 | (nconc (list (match-string-no-properties index) |