From 18c5609ea0bcf478cef1cbb697fa5081ee68c35b Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Sun, 25 Apr 2010 09:13:42 +0200 Subject: [PATCH] Make sure result buffer of LaTeX export is in LaTeX mode Report and patch from Dan Davison --- lisp/ChangeLog | 3 +++ lisp/org-latex.el | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1c0f9c3e8..2623ffaeb 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2010-04-25 Carsten Dominik + * 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. diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 8e3cd7fee..773ec0f4a 100644 --- a/lisp/org-latex.el +++ b/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))