emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH] bug in org-babel-execute-src-block


From: Aaron Ecay
Subject: [O] [PATCH] bug in org-babel-execute-src-block
Date: Thu, 18 Apr 2013 04:16:16 -0400
User-agent: Notmuch/0.15.2+43~ge848af8 (http://notmuchmail.org) Emacs/24.3.50.1 (x86_64-unknown-linux-gnu)

Hello,

I’ve discovered a bug in org-babel-execute-src-block.  Calls to setf can
leak outside of the function and affect the library of babel.  The
attached org file illustrates the problem.  The attached patch fixes it.

Attachment: lob-bug.org
Description: Text document

>From 84531966dc5ca50fb56c61726694e988da3053eb Mon Sep 17 00:00:00 2001
From: Aaron Ecay <address@hidden>
Date: Thu, 18 Apr 2013 04:02:47 -0400
Subject: [PATCH 4/4] Fix bug in org-babel-execute-src-block

* lisp/ob-core.el (org-babel-execute-src-block): copy the info

Otherwise, the setf calls in this function can reach into and change
other configuration variables, such as the library of babel.
---
 lisp/ob-core.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 12fcecc..71e9d61 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -547,7 +547,9 @@ Optionally supply a value for PARAMS which will be merged 
with
 the header arguments specified at the front of the source code
 block."
   (interactive)
-  (let* ((info (or info (org-babel-get-src-block-info)))
+  (let* ((info (if info
+                  (copy-tree info)
+                (org-babel-get-src-block-info)))
         (merged-params (org-babel-merge-params (nth 2 info) params)))
     (when (org-babel-check-evaluate
           (let ((i info)) (setf (nth 2 i) merged-params) i))
-- 
1.8.2.1

-- 
Aaron Ecay

reply via email to

[Prev in Thread] Current Thread [Next in Thread]