فهرست منبع

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))