From: Kenichi Handa Date: Tue, 4 Jan 2000 08:15:09 +0000 (+0000) Subject: (Finsert_file_contents): Signal error if visiting file X-Git-Tag: emacs-pretest-21.0.90~5518 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9f57b6b4ef838e4bf025e1a253b89fd31d767c33;p=emacs.git (Finsert_file_contents): Signal error if visiting file in a non-empty buffer. --- diff --git a/src/fileio.c b/src/fileio.c index 17be8acfaab..c3f2a2c9cba 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3463,9 +3463,13 @@ actually used.") /* 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);