GNU bug report logs - #11156
24.0.95; require-final-newline and read-only files

Previous Next

Package: emacs;

Reported by: Christopher Schmidt <christopher <at> ch.ristopher.com>

Date: Mon, 2 Apr 2012 21:53:01 UTC

Severity: minor

Found in version 24.0.95

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Christopher Schmidt <christopher <at> ch.ristopher.com>
To: bug-gnu-emacs <at> gnu.org
Subject: bug#11156: 24.2.50;
	require-final-newline and read-only files (was: bug#11156: 24.0.95;
	require-final-newline and read-only files)
Date: Sun,  2 Sep 2012 19:55:34 +0100 (BST)
reopen 11156

Chong Yidong <cyd <at> gnu.org> writes:
> Christopher Schmidt <christopher <at> ch.ristopher.com> writes:
>
>>> `after-find-file' shouldn't try adding a newline if
>>> `buffer-read-only' is non-nil.  And the values 'visit and
>>> 'visit-save should be documented in the Elisp manual.
>>
>> === modified file 'doc/lispref/ChangeLog'
>> ...
>
> Thanks, committed to the repository.

There is still a minor bug in regard to require-final-newline.

Recipe:
emacs -q
M-: (setq require-final-newline 'visit)
Open an image file via C-x C-f

There is a new buffer but no window displays it.  The *Messages*-buffer
contains "find-file-noselect-1: Text is read-only".

This is because image-mode sets the read-only property of the whole
buffer string to t.  buffer-read-only is nil in this case, though.

I think all code fragments that try to add new lines due to
require-final-newline should ignore text-read-only errors.

        Christopher




This bug report was last modified 12 years and 319 days ago.

Previous Next


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