Mercurial > emacs
changeset 27134:ac336ecd19ff
(Finsert_file_contents): Signal error if visiting file
in a non-empty buffer.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Tue, 04 Jan 2000 08:15:09 +0000 |
parents | 26255ac6099d |
children | 27b3c145fd73 |
files | src/fileio.c |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/fileio.c Tue Jan 04 08:14:39 2000 +0000 +++ b/src/fileio.c Tue Jan 04 08:15:09 2000 +0000 @@ -3463,9 +3463,13 @@ /* Prevent redisplay optimizations. */ current_buffer->clip_changed = 1; - if (!NILP (beg) || !NILP (end)) - if (!NILP (visit)) - error ("Attempt to visit less than an entire file"); + if (!NILP (visit)) + { + if (!NILP (beg) || !NILP (end)) + error ("Attempt to visit less than an entire file"); + if (BEG < Z && NILP (replace)) + error ("Cannot do file visiting in a non-empty buffer"); + } if (!NILP (beg)) CHECK_NUMBER (beg, 0);