Browse Source

babel: tangle: Respond to changes in generic expansion function

	* ob-tangle.el (org-babel-tangle-collect-blocks): Supply
	variable assignment lines to generic expansion command
Dan Davison 9 years ago
parent
commit
a6720e38a3
1 changed files with 6 additions and 4 deletions
  1. 6 4
      lisp/ob-tangle.el

+ 6 - 4
lisp/ob-tangle.el

@@ -287,13 +287,15 @@ code blocks by language."
 					      current-heading block-counter))))
 	     (src-lang (nth 0 info))
 	     (expand-cmd (intern (concat "org-babel-expand-body:" src-lang)))
+	     (assignments-cmd (intern (concat "org-babel-variable-assignments:" src-lang)))
 	     (body ((lambda (body)
 		      (if (assoc :no-expand params)
 			  body
-			(funcall (if (fboundp expand-cmd)
-				     expand-cmd
-				   'org-babel-expand-body:generic)
-				 body params)))
+			(if (fboundp expand-cmd) (funcall expand-cmd body params)
+			  (org-babel-expand-body:generic
+			   body params
+			   (and (fboundp assignments-cmd)
+				(funcall assignments-cmd params))))))
 		    (if (and (cdr (assoc :noweb params))
 			     (let ((nowebs (split-string
 					    (cdr (assoc :noweb params)))))