emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Gauland <mikelygee@no8wireless.co.nz>
To: emacs-orgmode Org-Mode <emacs-orgmode@gnu.org>
Subject: [PATCH] Turning off wrapping
Date: Thu, 24 Jan 2013 16:54:20 +1300	[thread overview]
Message-ID: <5100B06C.2050501@no8wireless.co.nz> (raw)


[-- 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 --]

                 reply	other threads:[~2013-01-24  3:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5100B06C.2050501@no8wireless.co.nz \
    --to=mikelygee@no8wireless.co.nz \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).