# HG changeset patch # User Kenichi Handa # Date 946973709 0 # Node ID ac336ecd19ff614732e73d7b000258e8d1dba06a # Parent 26255ac6099d00d35f60dcd27a80c23b74a61603 (Finsert_file_contents): Signal error if visiting file in a non-empty buffer. diff -r 26255ac6099d -r ac336ecd19ff src/fileio.c --- 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);