From 2ae897bb351553f55d207b5e4eee993f92d5d686 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Mon, 5 May 2025 19:50:24 +0300 Subject: [PATCH] * lisp/outline.el (outline-minor-mode-highlight-buffer): Adjust match data. 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/outline.el b/lisp/outline.el index 5eb1852726e..9db47cdaf21 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -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) -- 2.39.5