After using org-save-outline-visibility the invisible parts of the buffer become invisible to isearch. I have to do something like calling org-global-cycle to restore the buffer to its original state and allow searching in its invisible parts again. The problem seems to be in the functions org-outline-overlay-data and org-set-outline-overlay-data. They save and restore just `invisible' overlays. They should do the same with `isearch-open-invisible' overlays. Or perhaps org-set-outline-overlay-data could simply use outline-flag-region? What do you think?
* org.el (org-set-outline-overlay-data): Use outline-flag-region to make a region invisible. This ensures all necessary actions, especially adding isearch-open-invisible property, are applied. --- lisp/org.el | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index a75f96e..c4196e8 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6599,8 +6599,7 @@ DATA should have been made by `org-outline-overlay-data'." (widen) (show-all) (mapc (lambda (c) - (setq o (make-overlay (car c) (cdr c))) - (overlay-put o 'invisible 'outline)) + (outline-flag-region (car c) (cdr c) t)) data))))) ;;; Folding of blocks -- 1.7.2.5
Any chance to get this patch applied? Or is there anything wrong with it? * org.el (org-set-outline-overlay-data): Use outline-flag-region to make a region invisible. This ensures all necessary actions, especially adding isearch-open-invisible property, are applied. --- lisp/org.el | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index a75f96e..c4196e8 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6599,8 +6599,7 @@ DATA should have been made by `org-outline-overlay-data'." (widen) (show-all) (mapc (lambda (c) - (setq o (make-overlay (car c) (cdr c))) - (overlay-put o 'invisible 'outline)) + (outline-flag-region (car c) (cdr c) t)) data))))) ;;; Folding of blocks -- 1.7.2.5
Hi Milan,
Milan Zamazal <pdm@zamazal.org> writes:
> Any chance to get this patch applied? Or is there anything wrong with
> it?
I looked at it and it looks good. I just wanted to
take the time to carefully test the consequences of
using `outline-flag-region'. The code behind is okay,
but interactions with code from outline must be thought
carefully.
I will look at this again.
Thanks for the reminder,
--
Bastien
Hi Milan,
Milan Zamazal <pdm@zamazal.org> writes:
> Any chance to get this patch applied? Or is there anything wrong with
> it?
I just applied it -- thanks for this patch and sorry it took so long to
apply it.
Best,
--
Bastien