]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/outline.el (outline-minor-mode-highlight-buffer): Adjust match data.
authorJuri Linkov <juri@linkov.net>
Mon, 5 May 2025 16:50:24 +0000 (19:50 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sat, 10 May 2025 08:49:58 +0000 (10:49 +0200)
After a successful call to 'outline-search-function'
set the end of the match data to the end of the line
that is equivalent to adding ".*" in the regexp.
This accompanies the recent change in 'outline-font-lock-keywords'.

(cherry picked from commit 6c3a995ed535f9fb492461a53442e4d8bd4deb17)

lisp/outline.el

index 5eb1852726ebfa2eab13fd722f7ef8e9426436cc..9db47cdaf21a53095784a160bda9960142ebeefa 100644 (file)
@@ -522,7 +522,10 @@ outline font-lock faces to those of major mode."
     (let ((regexp (unless outline-search-function
                     (concat "^\\(?:" outline-regexp "\\).*$"))))
       (while (if outline-search-function
-                 (funcall outline-search-function)
+                 (when-let* ((ret (funcall outline-search-function)))
+                   ;; This is equivalent to adding ".*" in the regexp above.
+                   (set-match-data (list (match-beginning 0) (pos-eol)))
+                   ret)
                (re-search-forward regexp nil t))
         (let ((overlay (make-overlay (match-beginning 0) (match-end 0))))
           (overlay-put overlay 'outline-highlight t)