diff options
author | Kenichi Handa <[email protected]> | 2000-01-04 08:15:09 +0000 |
---|---|---|
committer | Kenichi Handa <[email protected]> | 2000-01-04 08:15:09 +0000 |
commit | 9f57b6b4ef838e4bf025e1a253b89fd31d767c33 (patch) | |
tree | 18c121a39895456d4913301800b17b464af80b85 /src/fileio.c | |
parent | dd9f0750da5c9180332815dcac4fa529d1747f8c (diff) |
(Finsert_file_contents): Signal error if visiting file
in a non-empty buffer.
Diffstat (limited to 'src/fileio.c')
-rw-r--r-- | src/fileio.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/fileio.c b/src/fileio.c index 17be8acfaa..c3f2a2c9cb 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); |