diff options
| author | Christopher Schmidt <christopher@ch.ristopher.com> | 2012-04-18 14:24:13 +0800 |
|---|---|---|
| committer | Chong Yidong <cyd@gnu.org> | 2012-04-18 14:24:13 +0800 |
| commit | c09c46b263a4c47806775c57bea391612cad4404 (patch) | |
| tree | cb126b90cec1002c7c9556113232fc768173ea9d /lisp/files.el | |
| parent | 5f6530ea79767d596c1950a94d63415475e5b1df (diff) | |
| download | emacs-c09c46b263a4c47806775c57bea391612cad4404.tar.gz | |
Fix require-final-newline interaction with read-only buffers.
* lisp/files.el (after-find-file): Do not try to add a final newline
if the buffer is read-only.
Fixes: debbugs:11156
Diffstat (limited to 'lisp/files.el')
| -rw-r--r-- | lisp/files.el | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lisp/files.el b/lisp/files.el index fb4662e7ea8..d757e1a277c 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2152,6 +2152,7 @@ unless NOMODES is non-nil." (/= (char-after (1- (point-max))) ?\n) (not (and (eq selective-display t) (= (char-after (1- (point-max))) ?\r))) + (not buffer-read-only) (save-excursion (goto-char (point-max)) (insert "\n"))) |
