From mboxrd@z Thu Jan  1 00:00:00 1970
From: Sylvain Chouleur <sylvain.chouleur@gmail.com>
Subject: Re: [PATCH] Fix org-outline-overlay-data marker insertion-type
Date: Sat, 18 Jan 2014 18:27:55 +0100
Message-ID: <CAD_mUW2h1mUu7R9cp_JHO+ytmYEu9hbfFgqfc_6fm2J6xzoWkQ@mail.gmail.com>
References: <CAD_mUW07yL8ALHKzMj+iAN5S696i7xW0Q06DwVMMXeb-JAKT1A@mail.gmail.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary=001a113940cad5c37604f041fb39
Return-path: <emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org>
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55509)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <sylvain.chouleur@gmail.com>) id 1W4Zgv-000386-NM
	for emacs-orgmode@gnu.org; Sat, 18 Jan 2014 12:28:18 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <sylvain.chouleur@gmail.com>) id 1W4Zgu-0005O8-E9
	for emacs-orgmode@gnu.org; Sat, 18 Jan 2014 12:28:17 -0500
Received: from mail-qc0-x229.google.com ([2607:f8b0:400d:c01::229]:51681)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <sylvain.chouleur@gmail.com>) id 1W4Zgu-0005N7-7P
	for emacs-orgmode@gnu.org; Sat, 18 Jan 2014 12:28:16 -0500
Received: by mail-qc0-f169.google.com with SMTP id w7so4744769qcr.28
	for <emacs-orgmode@gnu.org>; Sat, 18 Jan 2014 09:28:15 -0800 (PST)
In-Reply-To: <CAD_mUW07yL8ALHKzMj+iAN5S696i7xW0Q06DwVMMXeb-JAKT1A@mail.gmail.com>
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
	<mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
	<mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org
Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org
To: emacs-orgmode@gnu.org

--001a113940cad5c37604f041fb39
Content-Type: multipart/alternative; boundary=001a113940cad5c37304f041fb37

--001a113940cad5c37304f041fb37
Content-Type: text/plain; charset=ISO-8859-1

A little fix on my last patch:
set the insertion type to t only for the end bound of the overlay as only
this one should move on insertion

-- 
Sylvain


2014/1/15 Sylvain Chouleur <sylvain.chouleur@gmail.com>

> Hi all,
>
> here is a patch that fixes outline visibility saving.
>
> The root issue I've found is that when you call org-babel-execute-subtree
> on a folded outline, the result is shown visible so the visibility property
> is not well kept.
>
> The root cause is the markers used by org-outline-overlay-data to bound
> the invisible area.
> When org-babel-insert-result is called by org-babel-execute-subtree, text
> is added from the position of marker that mark the end of invisible area.
> As the insertion-type of the marker is by default nil, the marker stays
> where it is but text is inserted after, so the inserted text becomes
> visible.
>
> I'm not sure about the fix, I'm fearing some side effect I can't see in my
> usage so it's open to any comments
>
> Thanks
>
> --
> Sylvain
>

--001a113940cad5c37304f041fb37
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">A little fix on my last patch:<div>set the insertion type =
to t only for the end bound of the overlay as only this one should move on =
insertion</div><div><br></div><div>--=A0</div><div>Sylvain</div></div><div =
class=3D"gmail_extra">

<br><br><div class=3D"gmail_quote">2014/1/15 Sylvain Chouleur <span dir=3D"=
ltr">&lt;<a href=3D"mailto:sylvain.chouleur@gmail.com" target=3D"_blank">sy=
lvain.chouleur@gmail.com</a>&gt;</span><br><blockquote class=3D"gmail_quote=
" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir=3D"ltr">Hi all,<div><br></div><div>here is a patch that fixes outl=
ine visibility saving.</div><div><br></div><div>The root issue I&#39;ve fou=
nd is that when you call org-babel-execute-subtree on a folded outline, the=
 result is shown visible so the visibility property is not well kept.</div>


<div><br></div><div>The root cause is the markers used by=A0org-outline-ove=
rlay-data to bound the invisible area.</div><div>When=A0org-babel-insert-re=
sult is called by org-babel-execute-subtree, text is added from the positio=
n of marker that mark the end of invisible area.</div>


<div>As the insertion-type of the marker is by default nil, the marker stay=
s where it is but text is inserted after, so the inserted text becomes visi=
ble.</div><div><br></div><div>I&#39;m not sure about the fix, I&#39;m feari=
ng some side effect I can&#39;t see in my usage so it&#39;s open to any com=
ments</div>


<div><br></div><div>Thanks</div><span class=3D"HOEnZb"><font color=3D"#8888=
88"><div><br></div><div>--=A0</div><div>Sylvain</div></font></span></div>
</blockquote></div><br></div>

--001a113940cad5c37304f041fb37--

--001a113940cad5c37604f041fb39
Content-Type: text/x-patch; charset=US-ASCII;
	name="0001-Fix-org-outline-overlay-data-marker-insertion-type.patch"
Content-Disposition: attachment;
	filename="0001-Fix-org-outline-overlay-data-marker-insertion-type.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_hql5fdp91

RnJvbSBhNGJiODVkOTU3N2UwNDU0ZTAxYWJlNTk2ZjkyYjE1MjAwN2MwZDlmIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBTeWx2YWluIENob3VsZXVyIDxzeWx2YWluLmNob3VsZXVyQGlu
dGVsLmNvbT4KRGF0ZTogV2VkLCAxNSBKYW4gMjAxNCAwMDozODo1NSArMDEwMApTdWJqZWN0OiBb
UEFUQ0hdIEZpeCBvcmctb3V0bGluZS1vdmVybGF5LWRhdGEgbWFya2VyIGluc2VydGlvbi10eXBl
CgoqIG9yZy5lbDogU2V0IHRoZSBpbnNlcnRpb24tdHlwZSBvZiBib3VuZHMgbWFya2VycyBvZ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