Commit 9f57b6b4 authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(Finsert_file_contents): Signal error if visiting file

in a non-empty buffer.
parent dd9f0750
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment