Browse Source

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

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

TINYCHANGE
Jérémie Courrèges-Anglas 13 years ago
parent
commit
6010e18ce4
1 changed files with 5 additions and 0 deletions
  1. 5 0
      lisp/org-latex.el

+ 5 - 0
lisp/org-latex.el

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