Keep track of match extents in occur-mode (bug#39121)
Use the `occur-target` text property to keep track of the extents of all matches on each line instead of just the start of the first match. Doing so allows us to highlight all matches when jumping to a matching line instead of just the first one, and it works in a more principled way. It also removes compatibility problems that were introduced with occur-highlight-regexp. For compatibility with code that populate their own occur-mode buffers, we still accept `occur-target` properties with a single marker as value. * lisp/replace.el (occur-highlight-regexp, occur-highlight-overlay): Remove. (occur-highlight-overlays): New. (occur--targets-start): New. * lisp/replace.el (occur-after-change-function): (occur-mode-find-occurrence): Replace with... (occur-mode--find-occurrences): ...this function that returns the whole `occur-target` property value. (occur-mode-goto-occurrence, occur-mode-goto-occurrence-other-window) (occur-goto-locus-delete-o, occur-mode-display-occurrence) (occur-engine): Adjust to new property format. (occur--highlight-occurrence): Replace with... (occur--highlight-occurrences): ...this function that takes the `occur-target` property value as argument. (occur-1): Don't use `occur-highlight-regexp`. * test/lisp/replace-tests.el (occur-highlight-occurrence): Adapt to new property format.
Showing with 91 additions and 88 deletions