From 8d7ab3a4b7a8f892547872204e2cf8e12cd36ffd Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Mon, 7 Jun 2010 14:08:06 -0700 Subject: [PATCH] babel: adding :noeval header argument to inhibit execution of code blocks on export * contrib/babel/lisp/org-babel.el (org-babel-header-arg-names): adding :noeval header argument which can be specified to inhibit the execution of a source block during export. * contrib/babel/lisp/org-babel-exp.el (org-babel-exp-do-export): adding :noeval header argument which can be specified to inhibit the execution of a source block during export. --- contrib/babel/lisp/org-babel-exp.el | 4 +++- contrib/babel/lisp/org-babel.el | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/babel/lisp/org-babel-exp.el b/contrib/babel/lisp/org-babel-exp.el index 86c4304f9..e27915493 100644 --- a/contrib/babel/lisp/org-babel-exp.el +++ b/contrib/babel/lisp/org-babel-exp.el @@ -122,7 +122,9 @@ options are taken from `org-babel-default-header-args'." "Return a string containing the exported content of the current code block respecting the value of the :exports header argument." (flet ((silently () (let ((session (cdr (assoc :session (third info))))) - (when (and session (not (equal "none" session))) + (when (and session + (not (equal "none" session)) + (not (assoc :noeval (third info)))) (org-babel-exp-results info type 'silent)))) (clean () (org-babel-remove-result info))) (case (intern (or (cdr (assoc :exports (third info))) "code")) diff --git a/contrib/babel/lisp/org-babel.el b/contrib/babel/lisp/org-babel.el index d87cffbb0..bb31161c2 100644 --- a/contrib/babel/lisp/org-babel.el +++ b/contrib/babel/lisp/org-babel.el @@ -93,7 +93,8 @@ then run `org-babel-pop-to-session'." (add-hook 'org-metadown-hook 'org-babel-pop-to-session-maybe) (defconst org-babel-header-arg-names - '(cache cmdline colnames dir exports file noweb results session tangle var) + '(cache cmdline colnames dir exports file noweb results + session tangle var noeval) "Common header arguments used by org-babel. Note that individual languages may define their own language specific header arguments as well.")