aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2008-09-20 21:41:05 +0000
committerGlenn Morris2008-09-20 21:41:05 +0000
commit6bddfc97687ba69eb9199f25a16197a1bd5cc3d3 (patch)
tree8b45348cdfe2923f0afa4ec445186a590d6b44e8
parent3102b3426386eb9537ab02a75964a7a4246da135 (diff)
downloademacs-6bddfc97687ba69eb9199f25a16197a1bd5cc3d3.tar.gz
emacs-6bddfc97687ba69eb9199f25a16197a1bd5cc3d3.zip
(Frename_file): Avoid copying to trash if a rename involves a delete. (Bug#964).
-rw-r--r--src/ChangeLog5
-rw-r--r--src/fileio.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c9241258c22..55d4ce23f82 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12008-09-20 Glenn Morris <rgm@gnu.org>
2
3 * fileio.c (Frename_file): Avoid copying to trash if a rename involves
4 a delete. (Bug#964).
5
12008-09-20 Eli Zaretskii <eliz@gnu.org> 62008-09-20 Eli Zaretskii <eliz@gnu.org>
2 7
3 * keyboard.c (Fset_quit_char, Fset_input_meta_mode) 8 * keyboard.c (Fset_quit_char, Fset_input_meta_mode)
diff --git a/src/fileio.c b/src/fileio.c
index a5541d544f2..6a9364d37bc 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2231,6 +2231,7 @@ This is what happens in interactive use with M-x. */)
2231 { 2231 {
2232 if (errno == EXDEV) 2232 if (errno == EXDEV)
2233 { 2233 {
2234 int count;
2234#ifdef S_IFLNK 2235#ifdef S_IFLNK
2235 symlink_target = Ffile_symlink_p (file); 2236 symlink_target = Ffile_symlink_p (file);
2236 if (! NILP (symlink_target)) 2237 if (! NILP (symlink_target))
@@ -2244,7 +2245,10 @@ This is what happens in interactive use with M-x. */)
2244 NILP (ok_if_already_exists) ? Qnil : Qt, 2245 NILP (ok_if_already_exists) ? Qnil : Qt,
2245 Qt, Qt); 2246 Qt, Qt);
2246 2247
2248 count = SPECPDL_INDEX ();
2249 specbind (intern ("delete-by-moving-to-trash"), Qnil);
2247 Fdelete_file (file); 2250 Fdelete_file (file);
2251 unbind_to (count, Qnil);
2248 } 2252 }
2249 else 2253 else
2250 report_file_error ("Renaming", list2 (file, newname)); 2254 report_file_error ("Renaming", list2 (file, newname));