emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Wrap: override default
@ 2012-12-10 21:34 Michael Gauland
  2012-12-13 22:37 ` Bastien
  2012-12-24  8:43 ` Bastien
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Gauland @ 2012-12-10 21:34 UTC (permalink / raw)
  To: emacs-orgmode


* lisp/ob.el (org-babel-insert-result): only wrap if the :wrap value is non-null.

It can be convenient to specify the :wrap property at a higher level (e.g., file
or tree), rather than for each block. This patch allows you to override the
propery by specifying :wrap with no argument.

TINYCHANGE
---
 lisp/ob.el |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lisp/ob.el b/lisp/ob.el
index 0aba523..757bc06 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -1998,7 +1998,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_" name))))
 		 ((member "html" result-params)
-- 
1.7.9

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Wrap: override default
  2012-12-10 21:34 [PATCH] Wrap: override default Michael Gauland
@ 2012-12-13 22:37 ` Bastien
  2012-12-24  8:43 ` Bastien
  1 sibling, 0 replies; 4+ messages in thread
From: Bastien @ 2012-12-13 22:37 UTC (permalink / raw)
  To: Michael Gauland; +Cc: emacs-orgmode

Hi Eric,

Michael Gauland <mikelygee@no8wireless.co.nz> writes:

> * lisp/ob.el (org-babel-insert-result): only wrap if the :wrap value is non-null.
>
> It can be convenient to specify the :wrap property at a higher level (e.g., file
> or tree), rather than for each block. This patch allows you to override the
> propery by specifying :wrap with no argument.

Can I apply this patch?

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Wrap: override default
  2012-12-10 21:34 [PATCH] Wrap: override default Michael Gauland
  2012-12-13 22:37 ` Bastien
@ 2012-12-24  8:43 ` Bastien
  2012-12-24 20:15   ` Michael Gauland
  1 sibling, 1 reply; 4+ messages in thread
From: Bastien @ 2012-12-24  8:43 UTC (permalink / raw)
  To: Michael Gauland; +Cc: emacs-orgmode

Hi Michael,

Michael Gauland <mikelygee@no8wireless.co.nz> writes:

>  		(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_" name))))
>  		 ((member "html" result-params)

Well, the patch is wrong, if (cdr (assoc :wrap (nth 2 info)))
is in the (and ...) sexp, no need to have it in the (or ...)
sexp?

I'll mark it as "not applicable".  I let you propose another
patch if you still need to fix an issue in this area.

Thanks!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Wrap: override default
  2012-12-24  8:43 ` Bastien
@ 2012-12-24 20:15   ` Michael Gauland
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Gauland @ 2012-12-24 20:15 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 419 bytes --]

On 24/12/12 21:43, Bastien wrote
> Well, the patch is wrong, if (cdr (assoc :wrap (nth 2 info)))
> is in the (and ...) sexp, no need to have it in the (or ...)
> sexp?
>
> I'll mark it as "not applicable".  I let you propose another
> patch if you still need to fix an issue in this area.
>
> Thanks!

Good catch. I haven't been able to reproduce the original problem, so
I'm happy to abandon this patch.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-12-24 20:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-10 21:34 [PATCH] Wrap: override default Michael Gauland
2012-12-13 22:37 ` Bastien
2012-12-24  8:43 ` Bastien
2012-12-24 20:15   ` 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).