GNU bug report logs - #34986
write-region not governed by require-final-newline

Previous Next

Package: emacs;

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

Date: Mon, 25 Mar 2019 03:30:02 UTC

Severity: wishlist

Tags: fixed

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 34986 <at> debbugs.gnu.org
Subject: Re: bug#34986: write-region not governed by require-final-newline
Date: Mon, 25 Mar 2019 04:08:38 +0000
積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:

> User, despite setting
>  require-final-newline t
> in .emacs, still finds he is often creating files without final
> newlines.
>
> It turns out write-region, which he often uses, is not governed by
> require-final-newline.
>
> I though the whole logic of require-final-newline was to help people add
> those newlines.

The user option require-final-newline is relevant only when visiting
files, not when writing to arbitrary ones, so you probably want to use
save-buffer instead of write-region or similar.

See (info "(emacs) Visiting"), (info "(emacs) Customize Save"), and
(info "(elisp) Saving Buffers").

-- 
Basil




This bug report was last modified 5 years and 220 days ago.

Previous Next


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