emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-save-outline-visibility and isearch
@ 2011-10-27 11:14 Milan Zamazal
  2011-10-31 21:40 ` [PATCH] Create visibility overlays properly Milan Zamazal
  0 siblings, 1 reply; 5+ messages in thread
From: Milan Zamazal @ 2011-10-27 11:14 UTC (permalink / raw)
  To: emacs-orgmode

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?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] Create visibility overlays properly
  2011-10-27 11:14 org-save-outline-visibility and isearch Milan Zamazal
@ 2011-10-31 21:40 ` Milan Zamazal
  2011-11-12 10:56   ` Milan Zamazal
  0 siblings, 1 reply; 5+ messages in thread
From: Milan Zamazal @ 2011-10-31 21:40 UTC (permalink / raw)
  To: emacs-orgmode

* 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Create visibility overlays properly
  2011-10-31 21:40 ` [PATCH] Create visibility overlays properly Milan Zamazal
@ 2011-11-12 10:56   ` Milan Zamazal
  2011-11-12 11:06     ` Bastien
  2011-11-15 17:41     ` Bastien
  0 siblings, 2 replies; 5+ messages in thread
From: Milan Zamazal @ 2011-11-12 10:56 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Create visibility overlays properly
  2011-11-12 10:56   ` Milan Zamazal
@ 2011-11-12 11:06     ` Bastien
  2011-11-15 17:41     ` Bastien
  1 sibling, 0 replies; 5+ messages in thread
From: Bastien @ 2011-11-12 11:06 UTC (permalink / raw)
  To: Milan Zamazal; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Create visibility overlays properly
  2011-11-12 10:56   ` Milan Zamazal
  2011-11-12 11:06     ` Bastien
@ 2011-11-15 17:41     ` Bastien
  1 sibling, 0 replies; 5+ messages in thread
From: Bastien @ 2011-11-15 17:41 UTC (permalink / raw)
  To: Milan Zamazal; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-11-15 17:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-27 11:14 org-save-outline-visibility and isearch Milan Zamazal
2011-10-31 21:40 ` [PATCH] Create visibility overlays properly Milan Zamazal
2011-11-12 10:56   ` Milan Zamazal
2011-11-12 11:06     ` Bastien
2011-11-15 17:41     ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).