From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Results with #+begin_example/#+end_example don't get overwritten Date: Tue, 28 Nov 2017 22:07:53 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a11c1867ac369d5055f12409e" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJo2w-0003Dl-6l for emacs-orgmode@gnu.org; Tue, 28 Nov 2017 17:08:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJo2v-0000KU-9J for emacs-orgmode@gnu.org; Tue, 28 Nov 2017 17:08:06 -0500 Received: from mail-yb0-x229.google.com ([2607:f8b0:4002:c09::229]:45243) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eJo2v-0000KG-3z for emacs-orgmode@gnu.org; Tue, 28 Nov 2017 17:08:05 -0500 Received: by mail-yb0-x229.google.com with SMTP id 184so586420ybw.12 for ; Tue, 28 Nov 2017 14:08:05 -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" To: emacs-org list --001a11c1867ac369d5055f12409e Content-Type: text/plain; charset="UTF-8" On Tue, Nov 28, 2017 at 4:58 PM Kaushal Modi wrote: > I think that this behavior is on a safe side and good, but there needs to > be a way for Org to figure out if the stuff following #+RESULTS is safe to > delete.. > > Can be probably have #+begin_results and #+end_results instead of > #+begin_example and #+end_example? And then process the > begin_results/end_results elements the same as example elements? > > That way, we can safely delete/overwrite the begin_results/end_results > blocks. > > In the above example, Org cannot know if that example block is babel > generated or user-typed. > > WDYT? > Or may be just do this: diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 00f0fe33ecf..f04392a96d2 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -2465,7 +2465,7 @@ in the buffer." (if (memq (org-element-type element) ;; Possible results types. '(drawer export-block fixed-width item plain-list src-block - table)) + example-block table)) (save-excursion (goto-char (min (point-max) ;for narrowed buffers (org-element-property :end element))) -- Kaushal Modi --001a11c1867ac369d5055f12409e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Nov 28= , 2017 at 4:58 PM Kaushal Modi <kaushal.modi@gmail.com> wrote:
I think that this behavior = is on a safe side and good, but there needs to be a way for Org to figure o= ut if the stuff following #+RESULTS is safe to delete..

Can be probably have #+begin_results and #+end_results instead of #+b= egin_example and #+end_example? And then process the begin_results/end_resu= lts elements the same as example elements?

That wa= y, we can safely delete/overwrite the begin_results/end_results blocks.

In the above example, Org cannot know if that example= block is babel generated or user-typed.

WDYT?
=

Or may be just do = this:

diff --git a/lisp/ob-core.el b/lisp/ob-core.= el
index 00f0fe33ecf..f04392a96d2 100644
--- a/lisp/ob-core.el
+++= b/lisp/ob-core.el
@@ -2465,7 +2465,7 @@ in the buffer."
=C2=A0= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0 (if (memq (org-element-type element)
=C2= =A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 ;; Possib= le results types.
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0=C2=A0 '(drawer export-block fixed-width item plain-list src-b= lock
-=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 table))
+=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 example-block table))
=C2= =A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (save-excursion<= br>=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0(goto-char (min (point= -max) ;for narrowed buffers
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0(org-element-property :end elem= ent)))


= --

Kaushal Modi

--001a11c1867ac369d5055f12409e--