Mercurial > emacs
comparison src/fileio.c @ 98284:29ea4287708c
(Qdelete_by_moving_to_trash): New Lisp_Object.
(syms_of_fileio): Add Qdelete_by_moving_to_trash.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sat, 20 Sep 2008 23:37:08 +0000 |
parents | 75edb944833f |
children | 05eaa923b9eb |
comparison
equal
deleted
inserted
replaced
98283:e38f9f28d6ce | 98284:29ea4287708c |
---|---|
198 #endif | 198 #endif |
199 | 199 |
200 /* Non-zero means call move-file-to-trash in Fdelete_file or | 200 /* Non-zero means call move-file-to-trash in Fdelete_file or |
201 Fdelete_directory. */ | 201 Fdelete_directory. */ |
202 int delete_by_moving_to_trash; | 202 int delete_by_moving_to_trash; |
203 | |
204 Lisp_Object Qdelete_by_moving_to_trash; | |
203 | 205 |
204 /* Lisp function for moving files to trash. */ | 206 /* Lisp function for moving files to trash. */ |
205 Lisp_Object Qmove_file_to_trash; | 207 Lisp_Object Qmove_file_to_trash; |
206 | 208 |
207 extern Lisp_Object Vuser_login_name; | 209 extern Lisp_Object Vuser_login_name; |
2244 so don't have copy-file prompt again. */ | 2246 so don't have copy-file prompt again. */ |
2245 NILP (ok_if_already_exists) ? Qnil : Qt, | 2247 NILP (ok_if_already_exists) ? Qnil : Qt, |
2246 Qt, Qt); | 2248 Qt, Qt); |
2247 | 2249 |
2248 count = SPECPDL_INDEX (); | 2250 count = SPECPDL_INDEX (); |
2249 specbind (intern ("delete-by-moving-to-trash"), Qnil); | 2251 specbind (Qdelete_by_moving_to_trash, Qnil); |
2250 Fdelete_file (file); | 2252 Fdelete_file (file); |
2251 unbind_to (count, Qnil); | 2253 unbind_to (count, Qnil); |
2252 } | 2254 } |
2253 else | 2255 else |
2254 report_file_error ("Renaming", list2 (file, newname)); | 2256 report_file_error ("Renaming", list2 (file, newname)); |
5667 DEFVAR_BOOL ("delete-by-moving-to-trash", &delete_by_moving_to_trash, | 5669 DEFVAR_BOOL ("delete-by-moving-to-trash", &delete_by_moving_to_trash, |
5668 doc: /* Specifies whether to use the system's trash can. | 5670 doc: /* Specifies whether to use the system's trash can. |
5669 When non-nil, the function `move-file-to-trash' will be used by | 5671 When non-nil, the function `move-file-to-trash' will be used by |
5670 `delete-file' and `delete-directory'. */); | 5672 `delete-file' and `delete-directory'. */); |
5671 delete_by_moving_to_trash = 0; | 5673 delete_by_moving_to_trash = 0; |
5674 Qdelete_by_moving_to_trash = intern ("delete-by-moving-to-trash"); | |
5672 Qmove_file_to_trash = intern ("move-file-to-trash"); | 5675 Qmove_file_to_trash = intern ("move-file-to-trash"); |
5673 staticpro (&Qmove_file_to_trash); | 5676 staticpro (&Qmove_file_to_trash); |
5674 | 5677 |
5675 defsubr (&Sfind_file_name_handler); | 5678 defsubr (&Sfind_file_name_handler); |
5676 defsubr (&Sfile_name_directory); | 5679 defsubr (&Sfile_name_directory); |