Browse Source

org-babel-exp: adding org-babel-lob-mode for fontification of lob lines

Eric Schulte 15 years ago
parent
commit
6851f07f92

+ 2 - 1
contrib/babel/lisp/org-babel-exp.el

@@ -117,7 +117,8 @@ options are taken from `org-babel-default-header-args'."
 		      (if (string-match "\n$" body) "" "\n")))
       ('lob (save-excursion
 	      (re-search-backward org-babel-lob-one-liner-regexp)
-	      (format "#+BEGIN_SRC babel\n%s\n#+END_SRC" (first (org-babel-lob-get-info)))))))
+	      (format "#+BEGIN_SRC org-babel-lob\n%s\n#+END_SRC"
+                      (first (org-babel-lob-get-info)))))))
 
 (defun org-babel-exp-results (body lang params type)
   (let ((params

+ 5 - 0
contrib/babel/lisp/org-babel-lob.el

@@ -93,5 +93,10 @@ the word 'call'."
 		   (concat ":var results=" (mapconcat #'identity info " ")))))))
     (org-babel-execute-src-block nil (list "emacs-lisp" "results" params))))
 
+(define-generic-mode org-babel-lob-mode
+  '("#") '("exports" "results" "tangle" "cmdline" "file" "session")
+  nil nil nil
+  "Major mode for fontification of library of babel lines on export")
+
 (provide 'org-babel-lob)
 ;;; org-babel-lob.el ends here

+ 0 - 3
contrib/lisp/org-babel-init.el

@@ -65,8 +65,5 @@
   (defun org-babel-load-library-of-babel ()
     (org-babel-lob-ingest (expand-file-name "library-of-babel.org" org-babel-lob-dir))))
 
-(unless (assoc "babel" org-src-lang-modes)
-  (add-to-list 'org-src-lang-modes (cons "babel" 'python)))
-
 (provide 'org-babel-init)
 ;;; org-babel-init.el ends here