emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Results with #+begin_example/#+end_example don't get overwritten
@ 2017-11-28 21:58 Kaushal Modi
  2017-11-28 22:07 ` Kaushal Modi
  0 siblings, 1 reply; 7+ messages in thread
From: Kaushal Modi @ 2017-11-28 21:58 UTC (permalink / raw)
  To: emacs-org list

[-- Attachment #1: Type: text/plain, Size: 2402 bytes --]

Hello,

This issue is at the opposite spectrum of the previous issue where the Org
element after #+RESULTS got overwritten..

Here's a MWE:

=====
#+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('À'.islower())
print('à'.islower())
#+END_SRC
=====

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

=====
#+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('À'.islower())
print('à'.islower())
#+END_SRC

#+RESULTS:
#+begin_example
True
False
True
False
False
False
False
False
False
True
#+end_example
=====

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

=====
#+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('À'.islower())
print('à'.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
=====

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?


-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 3180 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-11-29 18:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-28 21:58 Results with #+begin_example/#+end_example don't get overwritten Kaushal Modi
2017-11-28 22:07 ` Kaushal Modi
2017-11-28 22:36   ` Nicolas Goaziou
2017-11-28 22:45     ` Kaushal Modi
2017-11-28 23:16       ` Nicolas Goaziou
2017-11-28 23:24         ` Kaushal Modi
2017-11-29 18:10           ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).