From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Gauland Subject: [PATCH] ':wrap nowrap' disable wrapping Date: Sun, 03 Mar 2013 11:00:36 +1300 Message-ID: <51327684.1040602@no8wireless.co.nz> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2SHDFSJVNCTPDLHPTMSPG" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:44017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBuU6-0007L1-Lk for emacs-orgmode@gnu.org; Sat, 02 Mar 2013 17:00:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UBuU5-0005Vj-3q for emacs-orgmode@gnu.org; Sat, 02 Mar 2013 17:00:50 -0500 Received: from jersey.rurallink.co.nz ([114.134.15.197]:57968 helo=smtp.rurallink.co.nz) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBuU4-0005VL-I8 for emacs-orgmode@gnu.org; Sat, 02 Mar 2013 17:00:49 -0500 Received: from 114-134-7-192.rurallink.co.nz ([114.134.7.192] helo=[192.168.15.101]) by smtp.rurallink.co.nz with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1UBuTt-0003OC-LU for emacs-orgmode@gnu.org; Sun, 03 Mar 2013 11:00:38 +1300 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode Org-Mode This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2SHDFSJVNCTPDLHPTMSPG Content-Type: multipart/mixed; boundary="------------080203010306030103030705" This is a multi-part message in MIME format. --------------080203010306030103030705 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Babel: Disable wrapping * lisp/ob-core.el (org-babel-insert-result): If the argument to ':wrap' is 'nowrap', don't wrap the results. * doc/org.texi (Header Arguments): Describe 'nowrap' behaviour. This allows the results of a block to be inserted without wrapping, by overriding a ':wrap' property defined in an enclosing scope. --------------080203010306030103030705 Content-Type: text/x-diff; name="wrap.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="wrap.diff" diff --git a/doc/org.texi b/doc/org.texi index bd22c7a..7fe49d2 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -13972,6 +13972,10 @@ to @code{#+BEGIN_} and @code{#+END_}, which will= then be used to wrap the results. If not string is specified then the results will be wrapped in= a @code{#+BEGIN/END_RESULTS} block. =20 +The string ``nowrap'' (case insensitive) is treated specially. It will +disable wrapping, if it has been turned on by setting the :wrap property= at +a higher outline level. + @node Results of evaluation, Noweb reference syntax, Header arguments, W= orking With Source Code @section Results of evaluation @cindex code block, results of evaluation diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 275a4f7..bf84ef0 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -1893,6 +1893,13 @@ org ----- results are added inside of a \"#+BEGIN_= SRC org\" block. They are not comma-escaped when inserted, but Org syntax here will be discarded when exporting the file. =20 +wrap ---- if no argument is supplied, the results are added + inside a #+BEGIN_RESULTS block. If a string argument + is provided, the string is appended to #+BEGIN_ and + #+END_ to delimit the block, unless the string is + 'nowrap' (case insensitive), in which case the results=20 + will *not* be wrapped. + html ---- results are added inside of a #+BEGIN_HTML block. This is a good option if you code block will output html formatted text. @@ -2009,7 +2016,10 @@ code ---- the results are extracted in the syntax = of the source (setq end (point-marker)) ;; possibly wrap result (cond - ((assoc :wrap (nth 2 info)) + ((let ((w (assoc :wrap (nth 2 info)))) + (and w + (or (not (stringp (cdr w))) + (not (string=3D (upcase (cdr w)) "NOWRAP"))))) (let ((name (or (cdr (assoc :wrap (nth 2 info))) "RESULTS"))) (funcall wrap (concat "#+BEGIN_" name) (concat "#+END_" (car (org-split-string name)))))) --------------080203010306030103030705-- ------enig2SHDFSJVNCTPDLHPTMSPG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJRMnaIAAoJEKnkgIXLqylXExsQALHHvWSVvpgbT4aBq+u9CgrN D+k1ilu3o3gPdyGLPPU+qUYYDksMMmkAXj16My8wLR3aB+o8Nv/G+RUJjcAhnU5R copP7y/GwiACoCCaEbz3Q/pSa2WKQSQfDJZeAv8mK2qdZVwatSlUSC83ylxnxq3q D7Z4ZdPe3syzwE/N4qgFjJXMCHMGDL8TtZXmQlpc3EOmTTboJ5/XNC6MhhF+hluT lLjnQYv9pHV+hko4NYiRt4eu4wAnDOypFbAYDfN1aJ1JUAkgvCFVLD2xhbx1jz4E Xt5tELQ1Ky3tCKO4qOiQ8lj/HtL++AmYVKGRNRILR2/gNnc/i++e9xco9Zd6CMBY B/uYo1OCP9Ho1iR8JA8z/ILN5EW8CfoJdAVkqu4UUuLnGNJTjzMscMraxmXlv2Ln anRX029T9Aosm1qBVifei5Fjg9AoF2SGYSiFRdsyTUUjX7+tab/2rtyHP+6Vf1x7 95qY9Hk2Rk55QTPxVAOhpk6bLg+5wE+9HNzLMIdv8oNudve/kVzhCpaS0qWTl0zk O34FT4E1KgY2InpF/YY7a/ugm8iBuJ+EMGWgGtQrqKcv+T0VsKSeCoJKoAHHm7e/ DQHzVBXjR/s0SY/9NcgB0fu3Hhy9J9n+gbjPqmKyk89NxdmyIfpbwB93QCRK+neb eLY8oxe0370tyJe0plvQ =2Yvn -----END PGP SIGNATURE----- ------enig2SHDFSJVNCTPDLHPTMSPG--