diff options
author | Eric Schulte <schulte.eric@gmail.com> | 2011-01-07 11:41:15 -0700 |
---|---|---|
committer | Eric Schulte <schulte.eric@gmail.com> | 2011-01-07 11:41:15 -0700 |
commit | 8674006516c6d4654b8f3e2bb182789a38076f3b (patch) | |
tree | a82145e929b49e303ceabb8b40a50e720dccb7e7 | |
parent | bd11460542bfd5f662d6c0850159ed76222a8d63 (diff) | |
download | org-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.el | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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)) |