(insert-file): Report error if file is directory.
This commit is contained in:
parent
fc25d15df0
commit
3be6243a7d
1 changed files with 3 additions and 0 deletions
|
@ -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))))))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue