diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/fileio.c | 28 |
2 files changed, 31 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1b1a9c1ee73..eb996b92a73 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -3,6 +3,12 @@ | |||
| 3 | * regex.c (analyse_first): Fix setting of fastmap for unibyte | 3 | * regex.c (analyse_first): Fix setting of fastmap for unibyte |
| 4 | pattern string. | 4 | pattern string. |
| 5 | 5 | ||
| 6 | 2010-01-27 David De La Harpe Golden <david@harpegolden.net> | ||
| 7 | |||
| 8 | * fileio.c (Frename_file): Call copy-directory and | ||
| 9 | delete-directory for directories, in order to handle cross-device | ||
| 10 | renaming (Bug#3353). | ||
| 11 | |||
| 6 | 2010-01-25 Jan Djärv <jan.h.d@swipnet.se> | 12 | 2010-01-25 Jan Djärv <jan.h.d@swipnet.se> |
| 7 | 13 | ||
| 8 | * xfns.c (Fx_create_frame): If frame height is too big, try | 14 | * xfns.c (Fx_create_frame): If frame height is too big, try |
| @@ -9328,7 +9334,7 @@ | |||
| 9328 | (syms_of_xterm): Don't declare it any more. | 9334 | (syms_of_xterm): Don't declare it any more. |
| 9329 | (x_draw_glyph_string): Adjust to the new name. | 9335 | (x_draw_glyph_string): Adjust to the new name. |
| 9330 | 9336 | ||
| 9331 | 2008-06-10 David De La Harpe Golden <david@harpegolden.net> (tiny change) | 9337 | 2008-06-10 David De La Harpe Golden <david@harpegolden.net> |
| 9332 | 9338 | ||
| 9333 | * xterm.c (x_underline_minimum_display_offset): New var. | 9339 | * xterm.c (x_underline_minimum_display_offset): New var. |
| 9334 | (x_draw_glyph_string): Use it. | 9340 | (x_draw_glyph_string): Use it. |
diff --git a/src/fileio.c b/src/fileio.c index d6cb814641b..36eaf7db533 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -215,6 +215,12 @@ Lisp_Object Qdelete_by_moving_to_trash; | |||
| 215 | /* Lisp function for moving files to trash. */ | 215 | /* Lisp function for moving files to trash. */ |
| 216 | Lisp_Object Qmove_file_to_trash; | 216 | Lisp_Object Qmove_file_to_trash; |
| 217 | 217 | ||
| 218 | /* Lisp function for recursively copying directories. */ | ||
| 219 | Lisp_Object Qcopy_directory; | ||
| 220 | |||
| 221 | /* Lisp function for recursively deleting directories. */ | ||
| 222 | Lisp_Object Qdelete_directory; | ||
| 223 | |||
| 218 | extern Lisp_Object Vuser_login_name; | 224 | extern Lisp_Object Vuser_login_name; |
| 219 | 225 | ||
| 220 | #ifdef WINDOWSNT | 226 | #ifdef WINDOWSNT |
| @@ -2241,7 +2247,11 @@ This is what happens in interactive use with M-x. */) | |||
| 2241 | && (NILP (Fstring_equal (Fdowncase (file), Fdowncase (newname)))) | 2247 | && (NILP (Fstring_equal (Fdowncase (file), Fdowncase (newname)))) |
| 2242 | #endif | 2248 | #endif |
| 2243 | ) | 2249 | ) |
| 2244 | newname = Fexpand_file_name (Ffile_name_nondirectory (file), newname); | 2250 | { |
| 2251 | Lisp_Object fname = NILP (Ffile_directory_p (file)) | ||
| 2252 | ? file : Fdirectory_file_name (file); | ||
| 2253 | newname = Fexpand_file_name (Ffile_name_nondirectory (fname), newname); | ||
| 2254 | } | ||
| 2245 | else | 2255 | else |
| 2246 | newname = Fexpand_file_name (newname, Qnil); | 2256 | newname = Fexpand_file_name (newname, Qnil); |
| 2247 | 2257 | ||
| @@ -2279,15 +2289,21 @@ This is what happens in interactive use with M-x. */) | |||
| 2279 | NILP (ok_if_already_exists) ? Qnil : Qt); | 2289 | NILP (ok_if_already_exists) ? Qnil : Qt); |
| 2280 | else | 2290 | else |
| 2281 | #endif | 2291 | #endif |
| 2292 | if (Ffile_directory_p (file)) | ||
| 2293 | call4 (Qcopy_directory, file, newname, Qt, Qnil); | ||
| 2294 | else | ||
| 2295 | /* We have already prompted if it was an integer, so don't | ||
| 2296 | have copy-file prompt again. */ | ||
| 2282 | Fcopy_file (file, newname, | 2297 | Fcopy_file (file, newname, |
| 2283 | /* We have already prompted if it was an integer, | ||
| 2284 | so don't have copy-file prompt again. */ | ||
| 2285 | NILP (ok_if_already_exists) ? Qnil : Qt, | 2298 | NILP (ok_if_already_exists) ? Qnil : Qt, |
| 2286 | Qt, Qt); | 2299 | Qt, Qt); |
| 2287 | 2300 | ||
| 2288 | count = SPECPDL_INDEX (); | 2301 | count = SPECPDL_INDEX (); |
| 2289 | specbind (Qdelete_by_moving_to_trash, Qnil); | 2302 | specbind (Qdelete_by_moving_to_trash, Qnil); |
| 2290 | Fdelete_file (file); | 2303 | if (Ffile_directory_p (file)) |
| 2304 | call2 (Qdelete_directory, file, Qt); | ||
| 2305 | else | ||
| 2306 | Fdelete_file (file); | ||
| 2291 | unbind_to (count, Qnil); | 2307 | unbind_to (count, Qnil); |
| 2292 | } | 2308 | } |
| 2293 | else | 2309 | else |
| @@ -5727,6 +5743,10 @@ When non-nil, the function `move-file-to-trash' will be used by | |||
| 5727 | Qdelete_by_moving_to_trash = intern_c_string ("delete-by-moving-to-trash"); | 5743 | Qdelete_by_moving_to_trash = intern_c_string ("delete-by-moving-to-trash"); |
| 5728 | Qmove_file_to_trash = intern_c_string ("move-file-to-trash"); | 5744 | Qmove_file_to_trash = intern_c_string ("move-file-to-trash"); |
| 5729 | staticpro (&Qmove_file_to_trash); | 5745 | staticpro (&Qmove_file_to_trash); |
| 5746 | Qcopy_directory = intern_c_string ("copy-directory"); | ||
| 5747 | staticpro (&Qcopy_directory); | ||
| 5748 | Qdelete_directory = intern_c_string ("delete-directory"); | ||
| 5749 | staticpro (&Qdelete_directory); | ||
| 5730 | 5750 | ||
| 5731 | defsubr (&Sfind_file_name_handler); | 5751 | defsubr (&Sfind_file_name_handler); |
| 5732 | defsubr (&Sfile_name_directory); | 5752 | defsubr (&Sfile_name_directory); |