Org-mode mailing list
 help / color / mirror / Atom feed
* [PATCH] Turning off wrapping
@ 2013-01-24  3:54 Michael Gauland
  0 siblings, 0 replies; only message in thread
From: Michael Gauland @ 2013-01-24  3:54 UTC (permalink / raw)
  To: emacs-orgmode Org-Mode

[-- Attachment #1.1: Type: text/plain, Size: 987 bytes --]

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

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

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: ob-core.el.diff --]
[-- Type: text/x-diff; name="ob-core.el.diff", Size: 572 bytes --]

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
-		 ((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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-01-24  3:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-24  3:54 [PATCH] Turning off wrapping Michael Gauland

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ \
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:

AGPL code for this site: git clone