فهرست منبع

ob.el: Reintroduce ":results org" but using "#+BEGIN_SRC org", not "#+BEGIN_ORG"

* ob.el (org-babel-common-header-args-w-values)
(org-babel-insert-result): Reintroduce ":results org" but
using "#+BEGIN_SRC org", not "#+BEGIN_ORG".

* org.texi (results): Update documentation for ":results
drawer" and ":results org".
Bastien Guerry 12 سال پیش
والد
کامیت
440b9388d4
2فایلهای تغییر یافته به همراه13 افزوده شده و 3 حذف شده
  1. 6 2
      doc/org.texi
  2. 7 1
      lisp/ob.el

+ 6 - 2
doc/org.texi

@@ -13660,10 +13660,14 @@ buffer as quoted text.  E.g., @code{:results value verbatim}.
 @item @code{file}
 The results will be interpreted as the path to a file, and will be inserted
 into the Org mode buffer as a file link.  E.g., @code{:results value file}.
-@item @code{raw}, @code{org}
+@item @code{raw}
 The results are interpreted as raw Org mode code and are inserted directly
 into the buffer.  If the results look like a table they will be aligned as
 such by Org mode.  E.g., @code{:results value raw}.
+@item @code{org}
+The results are will be enclosed in a @code{BEGIN_SRC org} block.
+They are not comma-escaped by default but they will be if you hit @kbd{TAB}
+in the block and/or if you export the file.  E.g., @code{:results value org}.
 @item @code{html}
 Results are assumed to be HTML and will be enclosed in a @code{BEGIN_HTML}
 block.  E.g., @code{:results value html}.
@@ -13677,7 +13681,7 @@ E.g., @code{:results value code}.
 The result is converted to pretty-printed code and is enclosed in a code
 block.  This option currently supports Emacs Lisp, Python, and Ruby.  E.g.,
 @code{:results value pp}.
-@item @code{wrap}
+@item @code{drawer}
 The result is wrapped in a RESULTS drawer.  This can be useful for
 inserting @code{raw} or @code{org} syntax results in such a way that their
 extent is known and they can be automatically removed or replaced.

+ 7 - 1
lisp/ob.el

@@ -420,7 +420,7 @@ then run `org-babel-pop-to-session'."
     (noweb-sep  . :any)
     (padline	. ((yes no)))
     (results	. ((file list vector table scalar verbatim)
-		   (raw html latex code pp drawer)
+		   (raw html latex org code pp drawer)
 		   (replace silent append prepend)
 		   (output value)))
     (rownames	. ((no yes)))
@@ -1870,6 +1870,10 @@ drawer -- results are added directly to the Org-mode file as with
           \"raw\", but are wrapped in a RESULTS drawer, allowing
           them to later be replaced or removed automatically.
 
+org ----- results are added inside of a \"#+BEGIN_SRC org\" block.
+          They are not comma-escaped when inserted, but Org syntax
+          here will be discarded when exporting the file.
+
 html ---- results are added inside of a #+BEGIN_HTML block.  This
           is a good option if you code block will output html
           formatted text.
@@ -1980,6 +1984,8 @@ code ---- the results are extracted in the syntax of the source
 	    (funcall wrap "#+BEGIN_HTML" "#+END_HTML"))
 	   ((member "latex" result-params)
 	    (funcall wrap "#+BEGIN_LaTeX" "#+END_LaTeX"))
+	   ((member "org" result-params)
+	    (funcall wrap "#+BEGIN_SRC org" "#+END_SRC"))
 	   ((member "code" result-params)
 	    (funcall wrap (format "#+BEGIN_SRC %s%s" (or lang "none") results-switches)
 		     "#+END_SRC"))