emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: emacs-org list <emacs-orgmode@gnu.org>
Subject: Re: Results with #+begin_example/#+end_example don't get overwritten
Date: Tue, 28 Nov 2017 22:07:53 +0000	[thread overview]
Message-ID: <CAFyQvY1OTY-xg4==OSCAqR=UmfdxC=nVi78EPv8fPdKZMtrZ+Q@mail.gmail.com> (raw)
In-Reply-To: <CAFyQvY3vUbaxUVyNoXg7VaTnumULkKj8TSpZ-f65PG5A_GxAvg@mail.gmail.com>

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

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

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

  reply	other threads:[~2017-11-28 22:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28 21:58 Results with #+begin_example/#+end_example don't get overwritten Kaushal Modi
2017-11-28 22:07 ` Kaushal Modi [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFyQvY1OTY-xg4==OSCAqR=UmfdxC=nVi78EPv8fPdKZMtrZ+Q@mail.gmail.com' \
    --to=kaushal.modi@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).