]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix handling of require-final-newline in after-find-file.
authorChong Yidong <cyd@gnu.org>
Fri, 7 Sep 2012 10:53:29 +0000 (18:53 +0800)
committerChong Yidong <cyd@gnu.org>
Fri, 7 Sep 2012 10:53:29 +0000 (18:53 +0800)
* files.el (after-find-file): Don't fail on a read-only buffer if
require-final-newline is `visit' or `visit-save'.

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

index d7004237adf0e2b9981688ce05d5495af5e17b07..db3a3f5d044af7f7eddacf2595e28d0a42a03060 100644 (file)
@@ -1,5 +1,8 @@
 2012-09-07  Chong Yidong  <cyd@gnu.org>
 
+       * files.el (after-find-file): Don't fail on a read-only buffer if
+       require-final-newline is `visit' or `visit-save' (Bug#11156).
+
        * subr.el (read-char-choice): Allow quitting via ESC ESC.
 
        * userlock.el (ask-user-about-supersession-threat): Use
index 6528632c8415984767ff8fef415482d9c0c5db2e..fb4549f03992a9b905b97f1cc8d6e6603628aa12 100644 (file)
@@ -2145,7 +2145,7 @@ unless NOMODES is non-nil."
         (not buffer-read-only)
         (save-excursion
           (goto-char (point-max))
-          (insert "\n")))
+          (ignore-errors (insert "\n"))))
     (when (and buffer-read-only
               view-read-only
               (not (eq (get major-mode 'mode-class) 'special)))