[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG] No newline at end of exported HTML file [9.6.6 (release_9.6.6
From: |
Ihor Radchenko |
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 |
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>
- [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/06
- 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/)], Ihor Radchenko, 2023/10/07
- 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/)], YE, 2023/10/08
- 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/)], Ihor Radchenko, 2023/10/09
- 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/)], Max Nikulin, 2023/10/09
- 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/)], Ihor Radchenko, 2023/10/09
- 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/)], Max Nikulin, 2023/10/09
- 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/)], Ihor Radchenko, 2023/10/09
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/)], Bruno Barbier, 2023/10/09