Browse Source

org-babel now using the org-src-lang-modes variable newly added to org-mode

Eric Schulte 16 years ago
parent
commit
6d4404f4cb
1 changed files with 4 additions and 13 deletions
  1. 4 13
      lisp/org-babel-tangle.el

+ 4 - 13
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))