diff options
| author | Chong Yidong | 2012-09-07 18:53:29 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-09-07 18:53:29 +0800 |
| commit | 0d7eb2ea07501271ad5aed5ba3e3492e1c145e03 (patch) | |
| tree | 085df2503d240f104dad5b15990d3dcbad3ecc89 | |
| parent | 0a6bdaa1572f198b2034830197545087e8499b13 (diff) | |
| download | emacs-0d7eb2ea07501271ad5aed5ba3e3492e1c145e03.tar.gz emacs-0d7eb2ea07501271ad5aed5ba3e3492e1c145e03.zip | |
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
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/files.el | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d7004237adf..db3a3f5d044 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2012-09-07 Chong Yidong <cyd@gnu.org> | 1 | 2012-09-07 Chong Yidong <cyd@gnu.org> |
| 2 | 2 | ||
| 3 | * files.el (after-find-file): Don't fail on a read-only buffer if | ||
| 4 | require-final-newline is `visit' or `visit-save' (Bug#11156). | ||
| 5 | |||
| 3 | * subr.el (read-char-choice): Allow quitting via ESC ESC. | 6 | * subr.el (read-char-choice): Allow quitting via ESC ESC. |
| 4 | 7 | ||
| 5 | * userlock.el (ask-user-about-supersession-threat): Use | 8 | * 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." | |||
| 2145 | (not buffer-read-only) | 2145 | (not buffer-read-only) |
| 2146 | (save-excursion | 2146 | (save-excursion |
| 2147 | (goto-char (point-max)) | 2147 | (goto-char (point-max)) |
| 2148 | (insert "\n"))) | 2148 | (ignore-errors (insert "\n")))) |
| 2149 | (when (and buffer-read-only | 2149 | (when (and buffer-read-only |
| 2150 | view-read-only | 2150 | view-read-only |
| 2151 | (not (eq (get major-mode 'mode-class) 'special))) | 2151 | (not (eq (get major-mode 'mode-class) 'special))) |