emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] lisp/ob.el (org-babel-result-cond)
@ 2012-12-07 19:54 Achim Gratz
  2012-12-11 14:41 ` Eric Schulte
  0 siblings, 1 reply; 4+ messages in thread
From: Achim Gratz @ 2012-12-07 19:54 UTC (permalink / raw)
  To: emacs-orgmode


This has been in there for a while and only been visible due to
byte-compiler warnings about free variable result-params.  Either the
tests don't really exercise this code path well or we've been lucky that
result-params was bound to the correct value during all those calls.

--8<---------------cut here---------------start------------->8---
commit c92a0f22165ab25fb3e6fc5e130945c624f10c39 (HEAD, refs/heads/lth-mk)
Author: Achim Gratz <Stromeko@Stromeko.DE>
Date:   Fri Dec 7 20:48:24 2012 +0100

    org-babel: fix bug introduced in commit 78cdf149
    
    * lisp/ob.el (org-babel-result-cond): Macro expansion needs to unquote
      formal parameter `result-params´.

	Modified   lisp/ob.el
diff --git a/lisp/ob.el b/lisp/ob.el
index c030a7f..7b2213d 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -2564,14 +2564,14 @@ (defvar org-babel-temporary-directory)
 (defmacro org-babel-result-cond (result-params scalar-form &rest table-forms)
   "Call the code to parse raw string results according to RESULT-PARAMS."
   (declare (indent 1))
-  `(unless (member "none" result-params)
-     (if (or (member "scalar" result-params)
-	     (member "verbatim" result-params)
-	     (member "html" result-params)
-	     (member "code" result-params)
-	     (member "pp" result-params)
-	     (and (member "output" result-params)
-		  (not (member "table" result-params))))
+  `(unless (member "none" ,result-params)
+     (if (or (member "scalar" ,result-params)
+	     (member "verbatim" ,result-params)
+	     (member "html" ,result-params)
+	     (member "code" ,result-params)
+	     (member "pp" ,result-params)
+	     (and (member "output" ,result-params)
+		  (not (member "table" ,result-params))))
 	 ,scalar-form
        ,@table-forms)))
 

--8<---------------cut here---------------end--------------->8---


Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf rackAttack V1.04R1:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

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

* Re: [PATCH] lisp/ob.el (org-babel-result-cond)
  2012-12-07 19:54 [PATCH] lisp/ob.el (org-babel-result-cond) Achim Gratz
@ 2012-12-11 14:41 ` Eric Schulte
  2012-12-11 18:21   ` Achim Gratz
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Schulte @ 2012-12-11 14:41 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Achim Gratz <Stromeko@nexgo.de> writes:

> This has been in there for a while and only been visible due to
> byte-compiler warnings about free variable result-params.  Either the
> tests don't really exercise this code path well or we've been lucky that
> result-params was bound to the correct value during all those calls.
>

The `result-params' variable is *always* in scope every time this macro
is called.  In fact previously the Babel language files were told to
expect some variables to always be in scope without their being
explicitly passed in as parameters.  We've since begun passing these
things explicitly to the language functions to appease the compiler.

I'd like to apply this patch, however the format is not detected by git
am.  Could you re-generate this patch using git format-patch and attach
the resulting file?

Thanks,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

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

* Re: [PATCH] lisp/ob.el (org-babel-result-cond)
  2012-12-11 14:41 ` Eric Schulte
@ 2012-12-11 18:21   ` Achim Gratz
  2012-12-12  0:26     ` Eric Schulte
  0 siblings, 1 reply; 4+ messages in thread
From: Achim Gratz @ 2012-12-11 18:21 UTC (permalink / raw)
  To: emacs-orgmode

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

Eric Schulte writes:
> I'd like to apply this patch, however the format is not detected by git
> am.  Could you re-generate this patch using git format-patch and attach
> the resulting file?

Here it is:


[-- Attachment #2: 0001-org-babel-fix-bug-introduced-in-commit-78cdf149.patch --]
[-- Type: text/x-patch, Size: 1564 bytes --]

From d91ba35d143b806f9d615a93f34a10b4086f55a5 Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
Date: Fri, 7 Dec 2012 20:48:24 +0100
Subject: [PATCH 1/4] org-babel: fix bug introduced in commit 78cdf149
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/ob.el (org-babel-result-cond): Macro expansion needs to unquote
  formal parameter `result-params´.
---
 lisp/ob.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lisp/ob.el b/lisp/ob.el
index 0aba523..2f4f855 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -2567,14 +2567,14 @@ (defvar org-babel-temporary-directory)
 (defmacro org-babel-result-cond (result-params scalar-form &rest table-forms)
   "Call the code to parse raw string results according to RESULT-PARAMS."
   (declare (indent 1))
-  `(unless (member "none" result-params)
-     (if (or (member "scalar" result-params)
-	     (member "verbatim" result-params)
-	     (member "html" result-params)
-	     (member "code" result-params)
-	     (member "pp" result-params)
-	     (and (member "output" result-params)
-		  (not (member "table" result-params))))
+  `(unless (member "none" ,result-params)
+     (if (or (member "scalar" ,result-params)
+	     (member "verbatim" ,result-params)
+	     (member "html" ,result-params)
+	     (member "code" ,result-params)
+	     (member "pp" ,result-params)
+	     (and (member "output" ,result-params)
+		  (not (member "table" ,result-params))))
 	 ,scalar-form
        ,@table-forms)))
 
-- 
1.8.0.1


[-- Attachment #3: Type: text/plain, Size: 201 bytes --]



Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs

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

* Re: [PATCH] lisp/ob.el (org-babel-result-cond)
  2012-12-11 18:21   ` Achim Gratz
@ 2012-12-12  0:26     ` Eric Schulte
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Schulte @ 2012-12-12  0:26 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Achim Gratz <Stromeko@nexgo.de> writes:

> Eric Schulte writes:
>> I'd like to apply this patch, however the format is not detected by git
>> am.  Could you re-generate this patch using git format-patch and attach
>> the resulting file?
>
> Here it is:
>

Much Obliged,

I'll push this up when next I push to the git repo.

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

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

end of thread, other threads:[~2012-12-12  2:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-07 19:54 [PATCH] lisp/ob.el (org-babel-result-cond) Achim Gratz
2012-12-11 14:41 ` Eric Schulte
2012-12-11 18:21   ` Achim Gratz
2012-12-12  0:26     ` Eric Schulte

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