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 23:24:56 +0000 Message-ID: References: <878teqqbdf.fsf@nicolasgoaziou.fr> <87tvxeouy5.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114075da4beeba055f1354e3" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJpFV-0002Iv-0Z for emacs-orgmode@gnu.org; Tue, 28 Nov 2017 18:25:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJpFT-00053u-Tt for emacs-orgmode@gnu.org; Tue, 28 Nov 2017 18:25:09 -0500 Received: from mail-yw0-x22e.google.com ([2607:f8b0:4002:c05::22e]:34313) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eJpFT-00053d-Nl for emacs-orgmode@gnu.org; Tue, 28 Nov 2017 18:25:07 -0500 Received: by mail-yw0-x22e.google.com with SMTP id w128so678413ywa.1 for ; Tue, 28 Nov 2017 15:25:07 -0800 (PST) In-Reply-To: <87tvxeouy5.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: emacs-org list --001a114075da4beeba055f1354e3 Content-Type: text/plain; charset="UTF-8" On Tue, Nov 28, 2017 at 6:16 PM Nicolas Goaziou wrote: > > AFAICT, there is no place in the manual that explains what is the > RESULTS keyword OK, may be that's the first step :) and under what circumstances it could be useful to write > it manually. > No, I wasn't suggesting a use case where someone writes the #+RESULTS: contents manually. Here's what can happen though: A user could have this to begin with: ===== #+BEGIN_SRC emacs-lisp (message "Hello") #+END_SRC #+RESULTS: : Hello | some | thing | important | ===== Then for whatever reason, they choose to delete the RESULTS manually.. and the blank line after that too! ===== #+BEGIN_SRC emacs-lisp (message "Hello") #+END_SRC #+RESULTS: | some | thing | important | ===== Now C-c C-c in the src block will wipe out the user-entered table! ===== #+BEGIN_SRC emacs-lisp (message "Hello") #+END_SRC #+RESULTS: : Hello ===== That's why I proposed earlier to wrap the Org generated results in something like #+begin_results/#+end_results. That way, Org is always sure that what it's deleting/overwriting is not user-entered data. The current behavior is risky, or at least should somehow be documented. -- Kaushal Modi --001a114075da4beeba055f1354e3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Nov 28= , 2017 at 6:16 PM Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:

AFAICT, there is no place in the manual that explains what is the
RESULTS keyword

OK, may be that's the f= irst step :)

and u= nder what circumstances it could be useful to write
it manually.

No, I wasn't suggestin= g a use case where someone writes the #+RESULTS: contents manually.

Here's what can happen though:

A user could have this to begin with:

=3D=3D=3D= =3D=3D
#+BEGIN_SRC emacs-lisp
(message "Hello")<= br>#+END_SRC
#+RESULTS:
: Hello

| some | thing | important |=3D=3D=3D=3D=3D

Then for whatever reason, th= ey choose to delete the RESULTS manually.. and the blank line after that to= o!

=3D=3D=3D=3D=3D
#+BEGIN_SRC = emacs-lisp
(message "Hello")
#+END_SRC
#+RESULTS:
| s= ome | thing | important |
=3D=3D=3D=3D=3D

N= ow C-c C-c in the src block will wipe out the user-entered table!

=3D=3D=3D=3D=3D
#+BEGIN_SRC emacs-lisp
(me= ssage "Hello")
#+END_SRC
#+RESULTS:
: Hello
=3D=3D=3D= =3D=3D

That's why I proposed earlier to wr= ap the Org generated results in something like #+begin_results/#+end_result= s.

That way, Org is always sure that what it's= deleting/overwriting is not user-entered data.

Th= e current behavior is risky, or at least should somehow be documented.
<= /div>
--

Kaushal Modi

--001a114075da4beeba055f1354e3--