From: Chong Yidong Date: Fri, 7 Sep 2012 10:53:29 +0000 (+0800) Subject: Fix handling of require-final-newline in after-find-file. X-Git-Tag: emacs-24.2.90~374 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0d7eb2ea07501271ad5aed5ba3e3492e1c145e03;p=emacs.git Fix handling of require-final-newline in after-find-file. * 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 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d7004237adf..db3a3f5d044 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-09-07 Chong Yidong + * 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 diff --git a/lisp/files.el b/lisp/files.el index 6528632c841..fb4549f0399 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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)))