emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
   commit a706d16127d463adaa4f038b776e58326a5eea5b (patch)
   parent cd447fa11 Make `org-todo-yesterday' call `org-agenda-todo-yesterday' if necessary.
     tree 26847483f747014d469036b6f7c2e93a74d9de3a
   author Eric Schulte <eric.schulte@gmx.com>  2011-12-11 09:27:48 -0700
committer Eric Schulte <eric.schulte@gmx.com>  2011-12-11 09:51:27 -0700

wrap code block results in drawers rather than blocks

* lisp/ob.el (org-babel-insert-result): Do not examplize wrapped
  scalar results, simply wrap them.
  (org-babel-result-end): Find the end of results wrapped in a RESULTS
  drawer.
---
 lisp/ob.el  | 10 +++++++---
 lisp/org.el |  2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/lisp/ob.el b/lisp/ob.el
index 5610924c4..4d779d550 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -1703,6 +1703,10 @@ raw ----- results are added directly to the Org-mode file.  This
           is a good option if you code block will output org-mode
           formatted text.
 
+wrap ---- 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 ----- similar in effect to raw, only the results are wrapped
           in an org code block.  Similar to the raw option, on
           export the results will be interpreted as org-formatted
@@ -1821,9 +1825,7 @@ code ---- the results are extracted in the syntax of the source
 	   ((member "raw" result-params)
 	    (goto-char beg) (if (org-at-table-p) (org-cycle)))
 	   ((member "wrap" result-params)
-	    (when (and (stringp result) (not (member "file" result-params)))
-	      (org-babel-examplize-region beg end results-switches))
-	    (wrap "#+BEGIN_RESULT" "#+END_RESULT"))
+	    (wrap ":RESULTS:" ":END:"))
 	   ((and (not (proper-list-p result))
 		 (not (member "file" result-params)))
 	    (org-babel-examplize-region beg end results-switches)
@@ -1858,6 +1860,8 @@ code ---- the results are extracted in the syntax of the source
      ((org-at-item-p) (let* ((struct (org-list-struct))
 			     (prvs (org-list-prevs-alist struct)))
 			(org-list-get-list-end (point-at-bol) struct prvs)))
+     ((looking-at "^\\([ \t]*\\):RESULTS:")
+      (re-search-forward (concat "^" (match-string 1) ":END:")))
      (t
       (let ((case-fold-search t)
 	    (blocks-re (regexp-opt
diff --git a/lisp/org.el b/lisp/org.el
index a505b3421..30f92d1eb 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -846,7 +846,7 @@ than its value."
 	  (const :tag "No limit" nil)
 	  (integer :tag "Maximum level")))
 
-(defcustom org-drawers '("PROPERTIES" "CLOCK" "LOGBOOK")
+(defcustom org-drawers '("PROPERTIES" "CLOCK" "LOGBOOK" "RESULTS")
   "Names of drawers.  Drawers are not opened by cycling on the headline above.
 Drawers only open with a TAB on the drawer line itself.  A drawer looks like
 this:


glossary
--------
Commit objects reference one tree, and zero or more parents.

Single parent commits can typically generate a patch in
unified diff format via `git format-patch'.

Multiple parents means the commit is a merge.

Root commits have no ancestor.  Note that it is
possible to have multiple root commits when merging independent histories.

Every commit references one top-level tree object.

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