From: Ihor Radchenko <yantar92@posteo.net>
To: Bruno Barbier <brubar.cs@gmail.com>
Cc: YE <yet@ego.team>, Max Nikulin <manikulin@gmail.com>,
emacs-orgmode@gnu.org
Subject: Re: [BUG] No newline at end of exported HTML file [9.6.6 (release_9.6.6 @ /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/org/)]
Date: Mon, 09 Oct 2023 12:47:21 +0000 [thread overview]
Message-ID: <87wmvwklnq.fsf@localhost> (raw)
In-Reply-To: <6523f0cd.5d0a0220.2bb6e.3bfc@mx.google.com>
Bruno Barbier <brubar.cs@gmail.com> writes:
> The change seems to come from this commit:
>
> commit d7a55bbd537314d2776b082bd92a1a08b3edc84e
> Date: Wed Sep 28 12:07:14 2022 +0800
> org-latex-export-to-latex: Do not suppress major modes in babel
>
> It replaces 'write-file' with 'write-region', but, according to the
> documentation of 'require-final-newline', 'write-region' ignores
> 'require-final-newline'.
Thanks for narrowing down the cause!
We indeed cannot revert the commit - the change was made for a reason.
> See attached diff that reverts the problematic change.
>
> In summary, before this commit, Emacs was fixing exported text files
> (HTML, markdown, etc.) for free, adding a newline if needed for text
> files. It's not anymore. I'm not sure what would be the best way to
> fix this though.
I do not think that we need to honour `require-final-newline' during
export - this was (1) not documented; (2) caused inconsistency when
exporting with different user configs.
However, we indeed changed the existing behaviour.
AFAIU, `require-final-newline' is t by default, except binary data.
Also, Org export is not designed to generate binary output.
So, it should be OK to ensure the final newline manually, in
`org-export-to-file' - to minimize possible breakage.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
next prev parent reply other threads:[~2023-10-09 12:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-06 15:53 [BUG] No newline at end of exported HTML file [9.6.6 (release_9.6.6 @ /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/org/)] YE
2023-10-07 8:27 ` Ihor Radchenko
2023-10-08 19:40 ` YE
2023-10-09 11:29 ` Ihor Radchenko
2023-10-09 11:41 ` Max Nikulin
2023-10-09 11:46 ` Ihor Radchenko
2023-10-09 11:53 ` Max Nikulin
2023-10-09 12:06 ` Ihor Radchenko
2023-10-09 12:23 ` Bruno Barbier
2023-10-09 12:47 ` Ihor Radchenko [this message]
2023-10-10 11:21 ` Ihor Radchenko
2023-10-11 8:10 ` YE
2023-10-15 8:14 ` Ihor Radchenko
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=87wmvwklnq.fsf@localhost \
--to=yantar92@posteo.net \
--cc=brubar.cs@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=manikulin@gmail.com \
--cc=yet@ego.team \
/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).