mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-27 16:02:58 +00:00
org-babel now using the org-src-lang-modes variable newly added to org-mode
This commit is contained in:
parent
9e8b776c83
commit
6d4404f4cb
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue