]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix require-final-newline interaction with read-only buffers.
authorChristopher Schmidt <christopher@ch.ristopher.com>
Wed, 18 Apr 2012 06:24:13 +0000 (14:24 +0800)
committerChong Yidong <cyd@gnu.org>
Wed, 18 Apr 2012 06:24:13 +0000 (14:24 +0800)
* lisp/files.el (after-find-file): Do not try to add a final newline
if the buffer is read-only.

Fixes: debbugs:11156
lisp/ChangeLog
lisp/files.el

index 75b1c7799c417bbc4445b3d7535dab47e987fa83..eff89ba08c09e64128c6a20d902eee1bfdae1889 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-18  Christopher Schmidt  <christopher@ch.ristopher.com>
+
+       * files.el (after-find-file): Do not try to add a final newline if
+       the buffer is read-only (Bug#11156).
+
 2012-04-17  Richard Stallman  <rms@gnu.org>
 
        * mail/rmail.el (rmail-start-mail):
@@ -9,7 +14,7 @@
        (rmail-forward): Pass the Rmail buffer, not nil, for replybuffer.
 
        * mail/sendmail.el (mail-bury): Choose the first rmail-mode
-       buffer, not the last.  Reject temp buffers.  Use the rmail-mode 
+       buffer, not the last.  Reject temp buffers.  Use the rmail-mode
        buffer, not newbuf.
 
 2012-04-17  Juanma Barranquero  <lekktu@gmail.com>
index fb4662e7ea82cb231d4dca5887d032639b729686..d757e1a277cb987ff53d85fb7b326bd5b4a67d25 100644 (file)
@@ -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")))