Browse Source

babel: shorter language names no longer shadow larger names

  Previously "R" could overshadow "Ruby", and "C" could overshadow
  "Clojure", causing blocks of the longer language name to fail to
  load. This issue has now been fixed
Eric Schulte 15 năm trước cách đây
mục cha
commit
fc28dd538b
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      contrib/babel/lisp/org-babel.el

+ 4 - 1
contrib/babel/lisp/org-babel.el

@@ -153,7 +153,10 @@ can not be resolved.")
   "Add INTERPRETER to `org-babel-interpreters' and update
 `org-babel-src-block-regexp' appropriately."
   (unless (member interpreter org-babel-interpreters)
-    (setq org-babel-interpreters (cons interpreter org-babel-interpreters))
+    (setq org-babel-interpreters
+          (sort (cons interpreter org-babel-interpreters)
+		(lambda (left right)
+		  (> (length left) (length right)))))
     (org-babel-set-interpreters 'org-babel-interpreters org-babel-interpreters)))
 
 (defcustom org-babel-interpreters '()