emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-latex.el: append final newline to export buffer
@ 2012-04-11 18:41 Jérémie Courrèges-Anglas
  2012-04-20  9:50 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Jérémie Courrèges-Anglas @ 2012-04-11 18:41 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 276 bytes --]


Hi.

org-export-as-latex (sometimes?) doesn't add a final newline to the
exported buffer. It's getting in my way as I set require-final-newline
to 'query. Opinions?

-- 
Jérémie Courrèges-Anglas
GPG fingerprint: 61DB D9A0 00A4 67CF 2A90 8961 6191 8FBF 06A1 1494

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: Patch --]
[-- Type: text/x-patch, Size: 986 bytes --]

From 2cf51a01885071c948d20c641d2d2fded6c2d1e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Courr=C3=A8ges-Anglas?= <jca@wxcvbn.org>
Date: Wed, 11 Apr 2012 20:36:10 +0200
Subject: [PATCH] org-latex.el: append final newline to export buffer

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

TINYCHANGE
---
 lisp/org-latex.el |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index 4418dee..8e05616 100644
--- a/lisp/org-latex.el
+++ b/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))
-- 
1.7.6


[-- Attachment #2: Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] org-latex.el: append final newline to export buffer
  2012-04-11 18:41 [PATCH] org-latex.el: append final newline to export buffer Jérémie Courrèges-Anglas
@ 2012-04-20  9:50 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2012-04-20  9:50 UTC (permalink / raw)
  To: emacs-orgmode

jca+org@wxcvbn.org (Jérémie Courrèges-Anglas) writes:

> org-export-as-latex (sometimes?) doesn't add a final newline to the
> exported buffer. It's getting in my way as I set require-final-newline
> to 'query. Opinions?

Accepted and applied in master.  Thanks.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-20  9:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11 18:41 [PATCH] org-latex.el: append final newline to export buffer Jérémie Courrèges-Anglas
2012-04-20  9:50 ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).