From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Results with #+begin_example/#+end_example don't get overwritten Date: Tue, 28 Nov 2017 21:58:31 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c135c9c4d7287055f121f71" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJntt-0007p0-IR for emacs-orgmode@gnu.org; Tue, 28 Nov 2017 16:58:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJnts-0003Ir-8G for emacs-orgmode@gnu.org; Tue, 28 Nov 2017 16:58:45 -0500 Received: from mail-yb0-x22c.google.com ([2607:f8b0:4002:c09::22c]:34136) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eJnts-0003IS-0h for emacs-orgmode@gnu.org; Tue, 28 Nov 2017 16:58:44 -0500 Received: by mail-yb0-x22c.google.com with SMTP id k4so599917ybc.1 for ; Tue, 28 Nov 2017 13:58:43 -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" To: emacs-org list --94eb2c135c9c4d7287055f121f71 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, This issue is at the opposite spectrum of the previous issue where the Org element after #+RESULTS got overwritten.. Here's a MWE: =3D=3D=3D=3D=3D #+TITLE: Results with #+begin_example/#+end_example do not get overwritten #+PROPERTY: header-args:python :exports both :results output #+BEGIN_SRC python print('a'.islower()) print('A'.islower()) print('abc'.islower()) print('Abc'.islower()) print('aBc'.islower()) print('012'.islower()) print('{}'.islower()) print('ABC'.islower()) print('=C3=80'.islower()) print('=C3=A0'.islower()) #+END_SRC =3D=3D=3D=3D=3D With point on the src block, hit C-c C-c; you will get: =3D=3D=3D=3D=3D #+TITLE: Results with #+begin_example/#+end_example do not get overwritten #+PROPERTY: header-args:python :exports both :results output #+BEGIN_SRC python print('a'.islower()) print('A'.islower()) print('abc'.islower()) print('Abc'.islower()) print('aBc'.islower()) print('012'.islower()) print('{}'.islower()) print('ABC'.islower()) print('=C3=80'.islower()) print('=C3=A0'.islower()) #+END_SRC #+RESULTS: #+begin_example True False True False False False False False False True #+end_example =3D=3D=3D=3D=3D But doing C-c C-c again will now give: =3D=3D=3D=3D=3D #+TITLE: Results with #+begin_example/#+end_example do not get overwritten #+PROPERTY: header-args:python :exports both :results output #+BEGIN_SRC python print('a'.islower()) print('A'.islower()) print('abc'.islower()) print('Abc'.islower()) print('aBc'.islower()) print('012'.islower()) print('{}'.islower()) print('ABC'.islower()) print('=C3=80'.islower()) print('=C3=A0'.islower()) #+END_SRC #+RESULTS: #+begin_example True False True False False False False False False True #+end_example #+begin_example True False True False False False False False False True #+end_example =3D=3D=3D=3D=3D 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? --=20 Kaushal Modi --94eb2c135c9c4d7287055f121f71 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

This issue is at t= he opposite spectrum of the previous issue where the Org element after #+RE= SULTS got overwritten..

Here's a MWE:

=3D=3D=3D=3D= =3D
#+TITLE: Results with #+begin_example/#+end_example do not get overw= ritten
#+PROPERTY: header-args:python :exports both :results output
<= br>#+BEGIN_SRC python
print('a'.islower())
print('A'.= islower())
print('abc'.islower())
print('Abc'.islower= ())
print('aBc'.islower())
print('012'.islower())
= print('{}'.islower())
print('ABC'.islower())
print(&#= 39;=C3=80'.islower())
print('=C3=A0'.islower())
#+END_SRC=
=3D=3D=3D=3D=3D

With point on the src block, hit C-c C-c; = you will get:

=3D=3D=3D=3D=3D
#+TITLE: Results with #+begin_examp= le/#+end_example do not get overwritten
#+PROPERTY: header-args:python := exports both :results output

#+BEGIN_SRC python
print('a'= .islower())
print('A'.islower())
print('abc'.islower(= ))
print('Abc'.islower())
print('aBc'.islower())
p= rint('012'.islower())
print('{}'.islower())
print(= 9;ABC'.islower())
print('=C3=80'.islower())
print('= =C3=A0'.islower())
#+END_SRC

#+RESULTS:
#+begin_exampleTrue
False
True
False
False
False
False
False
Fals= e
True
#+end_example
=3D=3D=3D=3D=3D

But doing C-c C-= c again will now give:

=3D=3D=3D=3D=3D
#+TITLE: Results with #+be= gin_example/#+end_example do not get overwritten
#+PROPERTY: header-args= :python :exports both :results output

#+BEGIN_SRC python
print(&#= 39;a'.islower())
print('A'.islower())
print('abc'= .islower())
print('Abc'.islower())
print('aBc'.islowe= r())
print('012'.islower())
print('{}'.islower())
= print('ABC'.islower())
print('=C3=80'.islower())
prin= t('=C3=A0'.islower())
#+END_SRC

#+RESULTS:
#+begin_exa= mple
True
False
True
False
False
False
False
False<= br>False
True
#+end_example
#+begin_example
True
False
Tr= ue
False
False
False
False
False
False
True
#+end_e= xample
=3D=3D=3D=3D=3D

I think that thi= s 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 ins= tead of #+begin_example and #+end_example? And then process the begin_resul= ts/end_results elements the same as example elements?

<= div>That way, we can safely delete/overwrite the begin_results/end_results = blocks.

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

WDYT?


--

Kaushal Modi

--94eb2c135c9c4d7287055f121f71--