From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sylvain Chouleur Subject: [PATCH] Fix org-outline-overlay-data marker insertion-type Date: Wed, 15 Jan 2014 01:19:04 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a11c306b8dc336304eff74253 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3ECc-0000WO-Gt for emacs-orgmode@gnu.org; Tue, 14 Jan 2014 19:19:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3ECb-0005Zl-Gp for emacs-orgmode@gnu.org; Tue, 14 Jan 2014 19:19:26 -0500 Received: from mail-qe0-x232.google.com ([2607:f8b0:400d:c02::232]:54702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3ECb-0005Zh-AL for emacs-orgmode@gnu.org; Tue, 14 Jan 2014 19:19:25 -0500 Received: by mail-qe0-f50.google.com with SMTP id 1so420229qec.9 for ; Tue, 14 Jan 2014 16:19:24 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 --001a11c306b8dc336304eff74253 Content-Type: multipart/alternative; boundary=001a11c306b8dc335e04eff74251 --001a11c306b8dc335e04eff74251 Content-Type: text/plain; charset=ISO-8859-1 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 --001a11c306b8dc335e04eff74251 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi all,

here is a patch that fixes outl= ine visibility saving.

The root issue I'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.

The root cause is the markers used by=A0org-outline-ove= rlay-data to bound the invisible area.
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.
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.

I'm not sure about the fix, I'm feari= ng some side effect I can't see in my usage so it's open to any com= ments

Thanks

--=A0
Sylvain=
--001a11c306b8dc335e04eff74251-- --001a11c306b8dc336304eff74253 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_hqfud9t10 RnJvbSBhNGJiODVkOTU3N2UwNDU0ZTAxYWJlNTk2ZjkyYjE1MjAwN2MwZDlmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTeWx2YWluIENob3VsZXVyIDxzeWx2YWluLmNob3VsZXVyQGlu dGVsLmNvbT4KRGF0ZTogV2VkLCAxNSBKYW4gMjAxNCAwMDozODo1NSArMDEwMApTdWJqZWN0OiBb UEFUQ0hdIEZpeCBvcmctb3V0bGluZS1vdmVybGF5LWRhdGEgbWFya2VyIGluc2VydGlvbi10eXBl CgoqIG9yZy5lbDogU2V0IHRoZSBpbnNlcnRpb24tdHlwZSBvZiBib3VuZHMgbWFya2VycyBvZgpv cmctb3V0bGluZS1vdmVybGF5LWRhdGEgdG8gdCAobWVhbnMgbWFya2VyIGFkdmFuY2VzIHdoZW4g eW91IGluc2VydAp0ZXh0IGF0IGl0KQoKVGhpcyBpcyB0byBjb25zZX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