I have file with a large number of SRC blocks, the output of which I
want to wrap as SRC (so I can use the listings package to format them
distinctly). The easiest way to do this is to make :wrap a global
property. Unfortunately, there are also a couple of places where I want
to turn off the wrapping, especially where I include source in-line. 
For example, this:

    #+PROPERTY: wrap SRC fundamental

    #+BEGIN_SRC emacs-lisp
    "This output comes from emacs."
    #+END_SRC

    This in-line src_emacs-lisp[:results value]{"block"} is wrapped.

produces:
    ,----
    | "This output comes from emacs."
    `----

    This in-line #+BEGIN_SRC fundamental block#+END_SRC is wrapped.

If I pass an empty :wrap in the in-line block, the result is still
wrapped, but as RESULTS instead of source.

The attached patch attempts to change this behaviour. Does anyone else
find this desirable? Is this patch a good way to do it?

Kind Regards,
Mike




diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 9e4c8b1..4d73fcc 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -1999,7 +1999,8 @@ code ---- the results are extracted in the syntax of the source
 		(setq end (point-marker))
 		;; possibly wrap result
 		(cond
-		 ((assoc :wrap (nth 2 info))
+		 ((and (assoc :wrap (nth 2 info))
+		       (cdr (assoc :wrap (nth 2 info))))
 		  (let ((name (or (cdr (assoc :wrap (nth 2 info))) "RESULTS")))
 		    (funcall wrap (concat "#+BEGIN_" name)
 			     (concat "#+END_" (car (org-split-string name))))))

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to