emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: jca+org@wxcvbn.org (Jérémie Courrèges-Anglas)
To: emacs-orgmode@gnu.org
Subject: [PATCH] org-latex.el: append final newline to export buffer
Date: Wed, 11 Apr 2012 20:41:33 +0200	[thread overview]
Message-ID: <87sjgai00y.fsf@moo.wxcvbn.org> (raw)


[-- 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 --]

             reply	other threads:[~2012-04-11 18:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-11 18:41 Jérémie Courrèges-Anglas [this message]
2012-04-20  9:50 ` [PATCH] org-latex.el: append final newline to export buffer Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sjgai00y.fsf@moo.wxcvbn.org \
    --to=jca+org@wxcvbn.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).