(insert-file): Report error if file is directory.

This commit is contained in:
Richard M. Stallman 1993-06-19 19:07:19 +00:00
parent fc25d15df0
commit 3be6243a7d

View file

@ -1550,6 +1550,9 @@ This function is meant for the user to run interactively.
Don't call it from programs! Use `insert-file-contents' instead.
\(Its calling sequence is different; see its documentation)."
(interactive "fInsert file: ")
(if (file-directory-p filename)
(signal 'file-error (list "Opening input file" "file is a directory"
filename)))
(let ((tem (insert-file-contents filename)))
(push-mark (+ (point) (car (cdr tem))))))