Commit 3be6243a authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

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

parent fc25d15d
......@@ -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))))))
......
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