]> code.delx.au - gnu-emacs/commitdiff
(insert-file): Report error if file is directory.
authorRichard M. Stallman <rms@gnu.org>
Sat, 19 Jun 1993 19:07:19 +0000 (19:07 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 19 Jun 1993 19:07:19 +0000 (19:07 +0000)
lisp/files.el

index dc07a02473a2636deacc336b9ba304d5ee38f203..3782a79472723b14aeb5aaed5fa40375c12fec63 100644 (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))))))