From 6d4404f4cbe7e9cd707464aa7962ea48a0593588 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Sun, 23 Aug 2009 12:38:16 -0600 Subject: [PATCH] org-babel now using the org-src-lang-modes variable newly added to org-mode --- lisp/org-babel-tangle.el | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/lisp/org-babel-tangle.el b/lisp/org-babel-tangle.el index f6317664e..660d4fb47 100644 --- a/lisp/org-babel-tangle.el +++ b/lisp/org-babel-tangle.el @@ -39,15 +39,6 @@ shebang(#!) line to use when writing out the language to file, and an optional flag indicating that the language is not commentable.") -;; This is just a place holder until this variable (or comparable) is -;; inserted into org-mode -(defcustom org-src-lang-modes - '(:ocaml "tuareg") - "Property list mapping languages to their major mode. -The key is the language name, the value is the string that should -be inserted as the name of the major mode." - :type 'plist) - (defun org-babel-load-file (file) "Load the contents of the Emacs Lisp source code blocks in the org-mode formatted FILE. This function will first export the @@ -88,8 +79,8 @@ exported source code blocks by language." (let* ((lang (car by-lang)) (specs (cdr by-lang)) (lang-f (intern (concat - (or (plist-get org-src-lang-modes - (intern (concat ":" lang))) + (or (symbol-name + (cdr (assoc lang org-src-lang-modes))) lang) "-mode"))) (lang-specs (cdr (assoc lang org-babel-tangle-langs))) @@ -222,8 +213,8 @@ the source-code block which holds BODY." (setq new-body (concat new-body text)))) (with-temp-buffer (insert body) (goto-char (point-min)) - (funcall (intern (concat (or (plist-get org-src-lang-modes - (intern (concat ":" lang))) + (funcall (intern (concat (or (symbol-name + (cdr (assoc lang org-src-lang-modes))) lang) "-mode"))) (setq index (point)) (while (and (re-search-forward "<<\\(.+\\)>>" nil t))