diff options
| author | Kim F. Storm | 2006-08-25 23:33:12 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2006-08-25 23:33:12 +0000 |
| commit | a9f2aeaeed9c9135c27e5abce0051b30d1467089 (patch) | |
| tree | 065d48957cb5cf60cb5e156de0face91a82d2e2a /src | |
| parent | a508663b2687133cd711ef801be11e0f299b5d9c (diff) | |
| download | emacs-a9f2aeaeed9c9135c27e5abce0051b30d1467089.tar.gz emacs-a9f2aeaeed9c9135c27e5abce0051b30d1467089.zip | |
(Fmake_directory_internal, Fdelete_directory)
(Fdelete_file): Simplify; use list1.
(Frename_file, Fadd_name_to_file, Fmake_symbolic_link):
Simplify; remove NO_ARG_ARRAY stuff, use list2.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/src/fileio.c b/src/fileio.c index 4a39e7ffa19..fa7a2d0cd85 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -2648,7 +2648,7 @@ DEFUN ("make-directory-internal", Fmake_directory_internal, | |||
| 2648 | #else | 2648 | #else |
| 2649 | if (mkdir (dir, 0777) != 0) | 2649 | if (mkdir (dir, 0777) != 0) |
| 2650 | #endif | 2650 | #endif |
| 2651 | report_file_error ("Creating directory", Flist (1, &directory)); | 2651 | report_file_error ("Creating directory", list1 (directory)); |
| 2652 | 2652 | ||
| 2653 | return Qnil; | 2653 | return Qnil; |
| 2654 | } | 2654 | } |
| @@ -2674,7 +2674,7 @@ DEFUN ("delete-directory", Fdelete_directory, Sdelete_directory, 1, 1, "FDelete | |||
| 2674 | dir = SDATA (encoded_dir); | 2674 | dir = SDATA (encoded_dir); |
| 2675 | 2675 | ||
| 2676 | if (rmdir (dir) != 0) | 2676 | if (rmdir (dir) != 0) |
| 2677 | report_file_error ("Removing directory", Flist (1, &directory)); | 2677 | report_file_error ("Removing directory", list1 (directory)); |
| 2678 | 2678 | ||
| 2679 | return Qnil; | 2679 | return Qnil; |
| 2680 | } | 2680 | } |
| @@ -2705,7 +2705,7 @@ If file has multiple names, it continues to exist with the other names. */) | |||
| 2705 | encoded_file = ENCODE_FILE (filename); | 2705 | encoded_file = ENCODE_FILE (filename); |
| 2706 | 2706 | ||
| 2707 | if (0 > unlink (SDATA (encoded_file))) | 2707 | if (0 > unlink (SDATA (encoded_file))) |
| 2708 | report_file_error ("Removing old name", Flist (1, &filename)); | 2708 | report_file_error ("Removing old name", list1 (filename)); |
| 2709 | return Qnil; | 2709 | return Qnil; |
| 2710 | } | 2710 | } |
| 2711 | 2711 | ||
| @@ -2739,9 +2739,6 @@ This is what happens in interactive use with M-x. */) | |||
| 2739 | (file, newname, ok_if_already_exists) | 2739 | (file, newname, ok_if_already_exists) |
| 2740 | Lisp_Object file, newname, ok_if_already_exists; | 2740 | Lisp_Object file, newname, ok_if_already_exists; |
| 2741 | { | 2741 | { |
| 2742 | #ifdef NO_ARG_ARRAY | ||
| 2743 | Lisp_Object args[2]; | ||
| 2744 | #endif | ||
| 2745 | Lisp_Object handler; | 2742 | Lisp_Object handler; |
| 2746 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; | 2743 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; |
| 2747 | Lisp_Object encoded_file, encoded_newname, symlink_target; | 2744 | Lisp_Object encoded_file, encoded_newname, symlink_target; |
| @@ -2810,15 +2807,7 @@ This is what happens in interactive use with M-x. */) | |||
| 2810 | Fdelete_file (file); | 2807 | Fdelete_file (file); |
| 2811 | } | 2808 | } |
| 2812 | else | 2809 | else |
| 2813 | #ifdef NO_ARG_ARRAY | 2810 | report_file_error ("Renaming", list2 (file, newname)); |
| 2814 | { | ||
| 2815 | args[0] = file; | ||
| 2816 | args[1] = newname; | ||
| 2817 | report_file_error ("Renaming", Flist (2, args)); | ||
| 2818 | } | ||
| 2819 | #else | ||
| 2820 | report_file_error ("Renaming", Flist (2, &file)); | ||
| 2821 | #endif | ||
| 2822 | } | 2811 | } |
| 2823 | UNGCPRO; | 2812 | UNGCPRO; |
| 2824 | return Qnil; | 2813 | return Qnil; |
| @@ -2834,9 +2823,6 @@ This is what happens in interactive use with M-x. */) | |||
| 2834 | (file, newname, ok_if_already_exists) | 2823 | (file, newname, ok_if_already_exists) |
| 2835 | Lisp_Object file, newname, ok_if_already_exists; | 2824 | Lisp_Object file, newname, ok_if_already_exists; |
| 2836 | { | 2825 | { |
| 2837 | #ifdef NO_ARG_ARRAY | ||
| 2838 | Lisp_Object args[2]; | ||
| 2839 | #endif | ||
| 2840 | Lisp_Object handler; | 2826 | Lisp_Object handler; |
| 2841 | Lisp_Object encoded_file, encoded_newname; | 2827 | Lisp_Object encoded_file, encoded_newname; |
| 2842 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 2828 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| @@ -2876,15 +2862,7 @@ This is what happens in interactive use with M-x. */) | |||
| 2876 | 2862 | ||
| 2877 | unlink (SDATA (newname)); | 2863 | unlink (SDATA (newname)); |
| 2878 | if (0 > link (SDATA (encoded_file), SDATA (encoded_newname))) | 2864 | if (0 > link (SDATA (encoded_file), SDATA (encoded_newname))) |
| 2879 | { | 2865 | report_file_error ("Adding new name", list2 (file, newname)); |
| 2880 | #ifdef NO_ARG_ARRAY | ||
| 2881 | args[0] = file; | ||
| 2882 | args[1] = newname; | ||
| 2883 | report_file_error ("Adding new name", Flist (2, args)); | ||
| 2884 | #else | ||
| 2885 | report_file_error ("Adding new name", Flist (2, &file)); | ||
| 2886 | #endif | ||
| 2887 | } | ||
| 2888 | 2866 | ||
| 2889 | UNGCPRO; | 2867 | UNGCPRO; |
| 2890 | return Qnil; | 2868 | return Qnil; |
| @@ -2902,9 +2880,6 @@ This happens for interactive use with M-x. */) | |||
| 2902 | (filename, linkname, ok_if_already_exists) | 2880 | (filename, linkname, ok_if_already_exists) |
| 2903 | Lisp_Object filename, linkname, ok_if_already_exists; | 2881 | Lisp_Object filename, linkname, ok_if_already_exists; |
| 2904 | { | 2882 | { |
| 2905 | #ifdef NO_ARG_ARRAY | ||
| 2906 | Lisp_Object args[2]; | ||
| 2907 | #endif | ||
| 2908 | Lisp_Object handler; | 2883 | Lisp_Object handler; |
| 2909 | Lisp_Object encoded_filename, encoded_linkname; | 2884 | Lisp_Object encoded_filename, encoded_linkname; |
| 2910 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 2885 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| @@ -2960,13 +2935,7 @@ This happens for interactive use with M-x. */) | |||
| 2960 | } | 2935 | } |
| 2961 | } | 2936 | } |
| 2962 | 2937 | ||
| 2963 | #ifdef NO_ARG_ARRAY | 2938 | report_file_error ("Making symbolic link", list2 (filename, linkname)); |
| 2964 | args[0] = filename; | ||
| 2965 | args[1] = linkname; | ||
| 2966 | report_file_error ("Making symbolic link", Flist (2, args)); | ||
| 2967 | #else | ||
| 2968 | report_file_error ("Making symbolic link", Flist (2, &filename)); | ||
| 2969 | #endif | ||
| 2970 | } | 2939 | } |
| 2971 | UNGCPRO; | 2940 | UNGCPRO; |
| 2972 | return Qnil; | 2941 | return Qnil; |