summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2011-01-07 11:41:15 -0700
committerEric Schulte <schulte.eric@gmail.com>2011-01-07 11:41:15 -0700
commit8674006516c6d4654b8f3e2bb182789a38076f3b (patch)
treea82145e929b49e303ceabb8b40a50e720dccb7e7
parentbd11460542bfd5f662d6c0850159ed76222a8d63 (diff)
downloadorg-mode-8674006516c6d4654b8f3e2bb182789a38076f3b.tar.gz
ob: Uses org-src-lang-modes to resolve language names for evaluation.
* lisp/ob.el (org-babel-execute-src-block): Uses org-src-lang-modes to resolve language names for evaluation.
-rw-r--r--lisp/ob.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/ob.el b/lisp/ob.el
index 8310bae..7502875 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -378,7 +378,6 @@ block."
(string= "tangle" noweb)))
(org-babel-expand-noweb-references info)
(nth 1 info)))))
- (cmd (intern (concat "org-babel-execute:" lang)))
(dir (cdr (assoc :dir params)))
(default-directory
(or (and dir (file-name-as-directory dir)) default-directory))
@@ -387,12 +386,18 @@ block."
org-babel-call-process-region-original
(symbol-function 'call-process-region)))
(indent (car (last info)))
- result)
+ result cmd)
(unwind-protect
(flet ((call-process-region (&rest args)
(apply 'org-babel-tramp-handle-call-process-region args)))
- (unless (fboundp cmd)
- (error "No org-babel-execute function for %s!" lang))
+ (flet ((lang-check (f)
+ (let ((f (intern (concat "org-babel-execute:" f))))
+ (when (fboundp f) f))))
+ (setq cmd
+ (or (lang-check lang)
+ (lang-check (symbol-name
+ (cdr (assoc lang org-src-lang-modes))))
+ (error "No org-babel-execute function for %s!" lang))))
(if (and (not arg) new-hash (equal new-hash old-hash))
(save-excursion ;; return cached result
(goto-char (org-babel-where-is-src-block-result nil info))