Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#561325: Does not add newline at end of file

5 views
Skip to first unread message

Marc MAURICE

unread,
Dec 16, 2009, 3:50:02 AM12/16/09
to
Package: leafpad
Version: 0.8.17-1

Leafpad doesn't add a newline character at end of file like other text
editors.

Steps to reproduce :

$ leafpad test.txt
# type in a simple word, save and quit
$ cat test.txt
myword$

Thanks in advance,
Good day !
Marc

--
Marc MAURICE
Ing�nieur Syst�me et R�seaux

Smile - Open Source Solutions (www.smile.fr)
26, cours Gambetta - 34000 Montpellier
T�l : 04 99 77 20 17

Courriel : marc.m...@smile.fr


--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Marc MAURICE

unread,
Mar 4, 2010, 4:00:01 AM3/4/10
to
Hello,

All standard text editors add a newline at end of files (vi, emacs,
gedit, kedit...).
Only Windows Notepad doesn't.

It's part of the POSIX standard :

http://www.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html#tag_03_205

See also the following arguments :

(scroll down to the last posts)

http://support.github.com/discussions/site/226-no-newline-at-end-of-file-appended-at-the-end-of-my-source-listing-in-the-commit-view
http://www.codeguru.com/forum/archive/index.php/t-423606.html

Thanks in advance,
Marc


Le 04/03/2010 00:48, Debian Bug Tracking System a �crit :
> This is an automatic notification regarding your Bug report
> which was filed against the leafpad package:
>
> #561325: Does not add newline at end of file
>
> It has been closed by Jari Aalto <jari....@cante.net>.
>
> Their explanation is attached below along with your original report.
> If this explanation is unsatisfactory and you have not received a
> better one in a separate message then please contact Jari Aalto <jari....@cante.net> by
> replying to this email.
>
>
>
>
> ------------------------------------------------------------------------
>
> Sujet:
> Bug#561325 Close
> Exp�diteur:
> Jari Aalto <jari....@cante.net>
> Date:
> Thu, 04 Mar 2010 01:46:17 +0200
> Destinataire:
> 56132...@bugs.debian.org
>
> Destinataire:
> 56132...@bugs.debian.org
>
>
> Reason for close:
>
> Standard editors do not add sxtra newlines. Feature will not be
> implmented.
>
> From: Tarot Osuji <ta...@sdf.lonestar.org>
> Subject: Re: Debian leafpad: new release with patches included?
> To: Jari Aalto <jari....@cante.net>
> Date: 1 hour, 1 minute -- 2010-03-04 00:43 EET
> Message-ID: <4B8EE5FB...@sdf.lonestar.org>
> References: <87iq9km...@jondo.cante.net>
>
> Hi Jari
>
> #561325
> WinXP's Notepad does not add newline at end of line. I feel no demand.
>
> Regards,
> Tarot
>
>
>
> ------------------------------------------------------------------------
>
> Sujet:
> Does not add newline at end of file
> Exp�diteur:
> Marc MAURICE <marc.m...@smile.fr>
> Date:
> Wed, 16 Dec 2009 08:50:34 +0100
> Destinataire:
> sub...@bugs.debian.org
>
> Destinataire:
> sub...@bugs.debian.org


>
>
> Package: leafpad
> Version: 0.8.17-1
>
> Leafpad doesn't add a newline character at end of file like other text
> editors.
>
> Steps to reproduce :
>
> $ leafpad test.txt
> # type in a simple word, save and quit
> $ cat test.txt
> myword$
>
> Thanks in advance,
> Good day !
> Marc
>

--

Jari Aalto

unread,
Mar 4, 2010, 5:00:02 AM3/4/10
to
Marc MAURICE <marc.m...@smile.fr> writes:

> Hello,
>
> All standard text editors add a newline at end of files (vi, emacs,
> gedit, kedit...).

I'm sure there are opinions in a way or another.

If editor does something more that what the user types, that behavior
may not please users that want full control.

E.g. emacs(1) doesn't change the file without special setting:

C-h v require-final-newline

require-final-newline is a variable defined in `files.el'.
Its value is nil

Documentation:
Whether to add a newline automatically at the end of the file.

There is also joe(1) which doesn' add newline. But as you pointed out,
there are editors that alwasys add <newline>, like vi(1). And for
programming code (C++ standard, compilers, diffs, patches) the final
newline is desired.

As the upstream of leafpad has no plans to add the feature, there is not
much we can do. I can only suggests to send him patches to make this
behavior configurable and hope the patches are accepted.

Jari

Marc MAURICE

unread,
Mar 4, 2010, 5:30:01 AM3/4/10
to
Ok, thanks Jari,

But emacs adds the newline when it create a text file from scratch by
default.

Can you just forward my last comment (about the posix standard) to the
upstream.
We should also ask them if they accept such a patch.

I can write it.

Thanks in advance,
Marc


--
Marc MAURICE
Ing�nieur Syst�me et R�seaux

Smile - Open Source Solutions (www.smile.fr)
26, cours Gambetta - 34000 Montpellier
T�l : 04 99 77 20 17

Courriel : marc.m...@smile.fr

Le 04/03/2010 10:42, Jari Aalto a �crit :

0 new messages