From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sylvain Chouleur Subject: Re: [PATCH] Fix org-outline-overlay-data marker insertion-type Date: Sat, 18 Jan 2014 18:27:55 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a113940cad5c37604f041fb39 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) 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 ) 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 ) 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 ; Sat, 18 Jan 2014 09:28:15 -0800 (PST) In-Reply-To: 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 --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 > 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
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

--=A0
Sylvain


2014/1/15 Sylvain Chouleur <sy= lvain.chouleur@gmail.com>
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

--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 CgoqI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