Browse Source

Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode

Carsten Dominik 14 years ago
parent
commit
e644a76dfb
2 changed files with 34 additions and 31 deletions
  1. 33 31
      lisp/ob-exp.el
  2. 1 0
      lisp/org.el

+ 33 - 31
lisp/ob-exp.el

@@ -252,37 +252,39 @@ results into the buffer."
 	      pair))
 	  (nth 2 info))))
     ;; skip code blocks which we can't evaluate
-    (when (fboundp (intern (concat "org-babel-execute:" lang)))
-      (case type
-	('inline
-	  (let ((raw (org-babel-execute-src-block
-		      nil info '((:results . "silent"))))
-		(result-params (split-string (cdr (assoc :results params)))))
-	    (unless silent
-	      (cond ;; respect the value of the :results header argument
-	       ((member "file" result-params)
-		(org-babel-result-to-file raw))
-	       ((or (member "raw" result-params) (member "org" result-params))
-		(format "%s" raw))
-	       ((member "code" result-params)
-		(format "src_%s{%s}" lang raw))
-	       (t
-		(if (stringp raw)
-		    (if (= 0 (length raw)) "=(no results)="
-		      (format "%s" raw))
-		  (format "%S" raw)))))))
-	('block
-	    (org-babel-execute-src-block
-	     nil info (org-babel-merge-params
-		       params `((:results . ,(if silent "silent" "replace")))))
-	  "")
-	('lob
-	 (save-excursion
-	   (re-search-backward org-babel-lob-one-liner-regexp nil t)
-	   (org-babel-execute-src-block
-	    nil info (org-babel-merge-params
-		      params `((:results . ,(if silent "silent" "replace")))))
-	   ""))))))
+    (if (fboundp (intern (concat "org-babel-execute:" lang)))
+	(case type
+	  ('inline
+	    (let ((raw (org-babel-execute-src-block
+			nil info '((:results . "silent"))))
+		  (result-params (split-string (cdr (assoc :results params)))))
+	      (unless silent
+		(cond ;; respect the value of the :results header argument
+		 ((member "file" result-params)
+		  (org-babel-result-to-file raw))
+		 ((or (member "raw" result-params) (member "org" result-params))
+		  (format "%s" raw))
+		 ((member "code" result-params)
+		  (format "src_%s{%s}" lang raw))
+		 (t
+		  (if (stringp raw)
+		      (if (= 0 (length raw)) "=(no results)="
+			(format "%s" raw))
+		    (format "%S" raw)))))))
+	  ('block
+	      (org-babel-execute-src-block
+	       nil info (org-babel-merge-params
+			 params
+			 `((:results . ,(if silent "silent" "replace")))))
+	    "")
+	  ('lob
+	   (save-excursion
+	     (re-search-backward org-babel-lob-one-liner-regexp nil t)
+	     (org-babel-execute-src-block
+	      nil info (org-babel-merge-params
+			params `((:results . ,(if silent "silent" "replace")))))
+	     "")))
+      "")))
 
 (provide 'ob-exp)
 

+ 1 - 0
lisp/org.el

@@ -123,6 +123,7 @@
 
 ;; load languages based on value of `org-babel-load-languages'
 (defvar org-babel-load-languages)
+;;;###autoload
 (defun org-babel-do-load-languages (sym value)
   "Load the languages defined in `org-babel-load-languages'."
   (set-default sym value)