summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2019-08-30 23:36:00 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2019-08-30 23:36:00 +0200
commitdf30a056b2a0a18a349cf02eb761c347608ac930 (patch)
tree3a449c3b6acfcc821bbd65f7d55de4845a789e62
parentfcc0d8f509f12ca55efe548bf78150d7ca0fc95a (diff)
downloadorg-mode-df30a056b2a0a18a349cf02eb761c347608ac930.tar.gz
Fix tangling bug when major mode for LANGUAGE is not `LANGUAGE-mode'
* lisp/ob-core.el (org-babel-expand-noweb-references): * lisp/ob-tangle.el (org-babel-tangle): Use `org-src-get-lang-mode' so as to use proper major mode. Reported-by: immanuel <immanuel.litzroth@gmail.com> <http://lists.gnu.org/r/emacs-orgmode/2019-08/msg00272.html>
-rw-r--r--lisp/ob-core.el3
-rw-r--r--lisp/ob-tangle.el8
2 files changed, 3 insertions, 8 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index ee66536..97ec18f 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -75,6 +75,7 @@
(declare-function org-show-context "org" (&optional key))
(declare-function org-src-coderef-format "org-src" (&optional element))
(declare-function org-src-coderef-regexp "org-src" (fmt &optional label))
+(declare-function org-src-get-lang-mode "org-src" (lang))
(declare-function org-table-align "org-table" ())
(declare-function org-table-end "org-table" (&optional table-type))
(declare-function org-table-import "org-table" (file arg))
@@ -2763,7 +2764,7 @@ block but are passed literally to the \"example-block\"."
;; Comment, according to LANG mode,
;; string S. Return new string.
(with-temp-buffer
- (funcall (intern (concat lang "-mode")))
+ (funcall (org-src-get-lang-mode lang))
(comment-region (point)
(progn (insert s) (point)))
(org-trim (buffer-string)))))
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index ca5dff4..2ea3341 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -228,13 +228,7 @@ used to limit the exported source code blocks by language."
(let* ((lang (car by-lang))
(specs (cdr by-lang))
(ext (or (cdr (assoc lang org-babel-tangle-lang-exts)) lang))
- (lang-f (intern
- (concat
- (or (and (cdr (assoc lang org-src-lang-modes))
- (symbol-name
- (cdr (assoc lang org-src-lang-modes))))
- lang)
- "-mode")))
+ (lang-f (org-src-get-lang-mode lang))
she-banged)
(mapc
(lambda (spec)