emacs-orgmode@gnu.org archives
 help / color / mirror / code / 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."
    #+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





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

^ permalink raw reply related	[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

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