GNU bug report logs - #49193
Document require-final-newline vs. readonly files

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Wed, 23 Jun 2021 17:49:01 UTC

Severity: wishlist

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49193 in the body.
You can then email your comments to 49193 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#49193; Package emacs. (Wed, 23 Jun 2021 17:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 23 Jun 2021 17:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Document require-final-newline vs. readonly files
Date: Wed, 23 Jun 2021 23:14:56 +0800
(info "(emacs) Customize Save") says:
   If the value of the variable ‘require-final-newline’ is ‘t’, saving or
   writing a file silently puts a newline at the end if there isn’t already
   one there.  If the value is ‘visit’, Emacs adds a newline at the end of
   any file that doesn’t have one, just after it visits the file...

OK, but mention if this even affects readonly files / owned by other users
that we visit.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49193; Package emacs. (Wed, 23 Jun 2021 18:07:02 GMT) Full text and rfc822 format available.

Message #8 received at 49193 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 49193 <at> debbugs.gnu.org
Subject: Re: bug#49193: Document require-final-newline vs. readonly files
Date: Wed, 23 Jun 2021 21:06:18 +0300
> From: 積丹尼 Dan Jacobson
>  <jidanni <at> jidanni.org>
> Date: Wed, 23 Jun 2021 23:14:56 +0800
> 
> (info "(emacs) Customize Save") says:
>    If the value of the variable ‘require-final-newline’ is ‘t’, saving or
>    writing a file silently puts a newline at the end if there isn’t already
>    one there.  If the value is ‘visit’, Emacs adds a newline at the end of
>    any file that doesn’t have one, just after it visits the file...
> 
> OK, but mention if this even affects readonly files / owned by other users
> that we visit.

There's nothing to mention, because this feature doesn't change how
saving to an unwritable file behaves in Emacs.  The feature works on
the buffer text, not on the buffer's file.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49193; Package emacs. (Wed, 23 Jun 2021 19:24:01 GMT) Full text and rfc822 format available.

Message #11 received at 49193 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 49193 <at> debbugs.gnu.org
Subject: Re: bug#49193: Document require-final-newline vs. readonly files
Date: Thu, 24 Jun 2021 03:22:22 +0800
>>>>> "EZ" == Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: 積丹尼 Dan Jacobson
>> <jidanni <at> jidanni.org>
>> Date: Wed, 23 Jun 2021 23:14:56 +0800
>> 
>> (info "(emacs) Customize Save") says:
>> If the value of the variable ‘require-final-newline’ is ‘t’, saving or
>> writing a file silently puts a newline at the end if there isn’t already
>> one there.  If the value is ‘visit’, Emacs adds a newline at the end of
>> any file that doesn’t have one, just after it visits the file...
>> 
>> OK, but mention if this even affects readonly files / owned by other users
>> that we visit.

EZ> There's nothing to mention, because this feature doesn't change how
EZ> saving to an unwritable file behaves in Emacs.  The feature works on
EZ> the buffer text, not on the buffer's file.

Ah, that clears things up.
So please mention that.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 24 Jun 2021 05:56:02 GMT) Full text and rfc822 format available.

Notification sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
bug acknowledged by developer. (Thu, 24 Jun 2021 05:56:02 GMT) Full text and rfc822 format available.

Message #16 received at 49193-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 49193-done <at> debbugs.gnu.org
Subject: Re: bug#49193: Document require-final-newline vs. readonly files
Date: Thu, 24 Jun 2021 08:55:39 +0300
> From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
> Cc: 49193 <at> debbugs.gnu.org
> Date: Thu, 24 Jun 2021 03:22:22 +0800
> 
> EZ> There's nothing to mention, because this feature doesn't change how
> EZ> saving to an unwritable file behaves in Emacs.  The feature works on
> EZ> the buffer text, not on the buffer's file.
> 
> Ah, that clears things up.
> So please mention that.

I don't see a reason to mention that feature A doesn't change how
feature B works, for every combination of A and B.

So I'm closing this bug report.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49193; Package emacs. (Thu, 24 Jun 2021 22:09:01 GMT) Full text and rfc822 format available.

Message #19 received at 49193 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: 49193 <at> debbugs.gnu.org
Cc: eliz <at> gnu.org, jidanni <at> jidanni.org
Subject: Re: bug#49193: Document require-final-newline vs. readonly files
Date: Fri, 25 Jun 2021 00:08:34 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> > From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
> > Cc: 49193 <at> debbugs.gnu.org
> > Date: Thu, 24 Jun 2021 03:22:22 +0800
> > 
> > EZ> There's nothing to mention, because this feature doesn't change how
> > EZ> saving to an unwritable file behaves in Emacs.  The feature works on
> > EZ> the buffer text, not on the buffer's file.
> > 
> > Ah, that clears things up.
> > So please mention that.
>
> I don't see a reason to mention that feature A doesn't change how
> feature B works, for every combination of A and B.

If you want a second opinion: That's not the source of my confusion
about the text:

| If the value is ‘visit’, Emacs adds a newline at the end of any file
| that doesn’t have one, just after it visits the file...

But that's not true, is it?  The file is not touched.  Is the newline
still added to the file's buffer?  Or not even that (because the buffer
is read-only)?

Would

| [...] Emacs adds a newline at the end of any file's buffer that
| doesn’t have one, just after it visits the file...

be clearer?


Thanks,

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49193; Package emacs. (Fri, 25 Jun 2021 06:08:02 GMT) Full text and rfc822 format available.

Message #22 received at 49193 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 49193 <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: Re: bug#49193: Document require-final-newline vs. readonly files
Date: Fri, 25 Jun 2021 09:07:31 +0300
> From: Michael Heerdegen <michael_heerdegen <at> web.de>
> Cc: eliz <at> gnu.org,  jidanni <at> jidanni.org
> Date: Fri, 25 Jun 2021 00:08:34 +0200
> 
> | If the value is ‘visit’, Emacs adds a newline at the end of any file
> | that doesn’t have one, just after it visits the file...
> 
> But that's not true, is it?  The file is not touched.  Is the newline
> still added to the file's buffer?  Or not even that (because the buffer
> is read-only)?
> 
> Would
> 
> | [...] Emacs adds a newline at the end of any file's buffer that
> | doesn’t have one, just after it visits the file...
> 
> be clearer?

Depends on the beholder, I guess.  Many newbies don't understand the
fine difference, and have trouble with the idea that Emacs doesn't
generally manipulate files for editing.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49193; Package emacs. (Sat, 26 Jun 2021 17:19:01 GMT) Full text and rfc822 format available.

Message #25 received at 49193 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, 49193 <at> debbugs.gnu.org
Subject: Re: bug#49193: Document require-final-newline vs. readonly files
Date: Sun, 27 Jun 2021 01:18:02 +0800
>> Would
>> 
>> | [...] Emacs adds a newline at the end of any file's buffer that
>> | doesn’t have one, just after it visits the file...
>> 
>> be clearer?

Better say **buffer** or BUFFER, not just plain buffer.

EZ> Depends on the beholder, I guess.  Many newbies don't understand the
EZ> fine difference, and have trouble with the idea that Emacs doesn't
EZ> generally manipulate files for editing.

It's correct that they don't understand the difference, so it would be
great if the manual helped a little to explain it, right there on that
page too in fact.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 25 Jul 2021 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 23 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.