浏览代码

Make sure result buffer of LaTeX export is in LaTeX mode

Report and patch from Dan Davison
Carsten Dominik 15 年之前
父节点
当前提交
18c5609ea0
共有 2 个文件被更改,包括 6 次插入1 次删除
  1. 3 0
      lisp/ChangeLog
  2. 3 1
      lisp/org-latex.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2010-04-25  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-latex.el (org-export-as-latex): Make sure that the
+	result buffer is in latex-mode.
+
 	* org.el (org-shiftup-final-hook, org-shiftdown-final-hook)
 	(org-shiftleft-final-hook, org-shiftright-final-hook): New
 	hooks.

+ 3 - 1
lisp/org-latex.el

@@ -793,7 +793,9 @@ when PUB-DIR is set, use this as the publishing directory."
 	  (replace-match "\n")))
 
     (run-hooks 'org-export-latex-final-hook)
-    (or to-buffer (save-buffer))
+    (if to-buffer
+	(unless (eq major-mode 'latex-mode) (latex-mode))
+      (save-buffer))
     (org-export-latex-fix-inputenc)
     (run-hooks 'org-export-latex-after-save-hook)
     (goto-char (point-min))