From: Juri Linkov Date: Mon, 5 May 2025 16:50:24 +0000 (+0300) Subject: * lisp/outline.el (outline-minor-mode-highlight-buffer): Adjust match data. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2ae897bb351553f55d207b5e4eee993f92d5d686;p=emacs.git * 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) --- 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)