Commit efdc16c9 authored by Francesco Potortì's avatar Francesco Potortì
Browse files

(Fdelete_directory, Fdelete_file): Document the

behaviour in front of symlinks.
(Fdelete_file): Raise an error on directories.
parent 64f51134
...@@ -2562,7 +2562,7 @@ DEFUN ("make-directory-internal", Fmake_directory_internal, ...@@ -2562,7 +2562,7 @@ DEFUN ("make-directory-internal", Fmake_directory_internal,
} }
DEFUN ("delete-directory", Fdelete_directory, Sdelete_directory, 1, 1, "FDelete directory: ", DEFUN ("delete-directory", Fdelete_directory, Sdelete_directory, 1, 1, "FDelete directory: ",
doc: /* Delete the directory named DIRECTORY. */) doc: /* Delete the directory named DIRECTORY. Does not follow symlinks. */)
(directory) (directory)
Lisp_Object directory; Lisp_Object directory;
{ {
...@@ -2588,15 +2588,21 @@ DEFUN ("delete-directory", Fdelete_directory, Sdelete_directory, 1, 1, "FDelete ...@@ -2588,15 +2588,21 @@ DEFUN ("delete-directory", Fdelete_directory, Sdelete_directory, 1, 1, "FDelete
} }
DEFUN ("delete-file", Fdelete_file, Sdelete_file, 1, 1, "fDelete file: ", DEFUN ("delete-file", Fdelete_file, Sdelete_file, 1, 1, "fDelete file: ",
doc: /* Delete file named FILENAME. doc: /* Delete file named FILENAME. If it is a symlink, remove the symlink.
If file has multiple names, it continues to exist with the other names. */) If file has multiple names, it continues to exist with the other names. */)
(filename) (filename)
Lisp_Object filename; Lisp_Object filename;
{ {
Lisp_Object handler; Lisp_Object handler;
Lisp_Object encoded_file; Lisp_Object encoded_file;
struct gcpro gcpro1;
CHECK_STRING (filename); GCPRO1 (filename);
if (!NILP (Ffile_directory_p (filename)))
Fsignal (Qfile_error,
Fcons (build_string ("Removing old name: is a directory"),
Fcons (filename, Qnil)));
UNGCPRO;
filename = Fexpand_file_name (filename, Qnil); filename = Fexpand_file_name (filename, Qnil);
handler = Ffind_file_name_handler (filename, Qdelete_file); handler = Ffind_file_name_handler (filename, Qdelete_file);
...@@ -6483,4 +6489,3 @@ a non-nil value. */); ...@@ -6483,4 +6489,3 @@ a non-nil value. */);
defsubr (&Sunix_sync); defsubr (&Sunix_sync);
#endif #endif
} }
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