From d3e8d0a9fc235b025f005158cc51f21e5e2ec8ee Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Fri, 24 Mar 2023 13:10:37 +0100 Subject: [PATCH] org-highlight-new-match: Make highlights always visible * lisp/org.el (org-highlight-new-match): Make highlights always visible, even upon folding. --- lisp/org.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 20e6ea6d9..1834eadbc 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10762,10 +10762,15 @@ (defun org-occur-next-match (&optional n _reset) (defun org-highlight-new-match (beg end) "Highlight from BEG to END and mark the highlight is an occur headline." - (let ((ov (make-overlay beg end))) + (let ((ov (make-overlay beg end)) + (ov-line (make-overlay + (org-with-point-at beg (max (point-min) (1- (pos-bol)))) + (org-with-point-at end (pos-eol))))) (overlay-put ov 'face 'secondary-selection) (overlay-put ov 'org-type 'org-occur) - (push ov org-occur-highlights))) + (overlay-put ov-line 'invisible 'org-occur) + (push ov org-occur-highlights) + (push ov-line org-occur-highlights))) (defun org-remove-occur-highlights (&optional _beg _end noremove) "Remove the occur highlights from the buffer. -- 2.39.1