org-latex.el: Append final newline to export buffer.

* lisp/org-latex.el: Ensure a final newline is appended to the export buffer.

TINYCHANGE
This commit is contained in:
Jérémie Courrèges-Anglas 2012-04-11 20:36:10 +02:00 committed by Bastien Guerry
parent d87ec54d4b
commit 6010e18ce4
1 changed files with 5 additions and 0 deletions

View File

@ -1034,6 +1034,11 @@ when PUB-DIR is set, use this as the publishing directory."
(if (looking-at "[\n \t]+")
(replace-match "\n")))
;; Ensure we have a final newline
(goto-char (point-max))
(or (eq (char-before) ?\n)
(insert ?\n))
(run-hooks 'org-export-latex-final-hook)
(if to-buffer
(unless (eq major-mode 'latex-mode) (latex-mode))