comparison src/fileio.c @ 37961:d95290112d89

(Fdo_auto_save): Don't try to create the directory of auto-save-list-file-name when shutting down Emacs, because creating the directory might signal an error, and leaves Emacs in a strange state.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 31 May 2001 09:58:33 +0000
parents 2db1b1bb1d18
children 835bdb0887ed
comparison
equal deleted inserted replaced
37960:7103eb9ef882 37961:d95290112d89
5368 if (!NILP (Vrun_hooks)) 5368 if (!NILP (Vrun_hooks))
5369 call1 (Vrun_hooks, intern ("auto-save-hook")); 5369 call1 (Vrun_hooks, intern ("auto-save-hook"));
5370 5370
5371 if (STRINGP (Vauto_save_list_file_name)) 5371 if (STRINGP (Vauto_save_list_file_name))
5372 { 5372 {
5373 Lisp_Object listfile, dir; 5373 Lisp_Object listfile;
5374 5374
5375 listfile = Fexpand_file_name (Vauto_save_list_file_name, Qnil); 5375 listfile = Fexpand_file_name (Vauto_save_list_file_name, Qnil);
5376 5376
5377 dir = Ffile_name_directory (listfile); 5377 /* Don't try to create the directory when shutting down Emacs,
5378 if (NILP (Ffile_directory_p (dir))) 5378 because creating the directory might signal an error, and
5379 call2 (Qmake_directory, dir, Qt); 5379 that would leave Emacs in a strange state. */
5380 if (!NILP (Vrun_hooks))
5381 {
5382 Lisp_Object dir;
5383 dir = Ffile_name_directory (listfile);
5384 if (NILP (Ffile_directory_p (dir)))
5385 call2 (Qmake_directory, dir, Qt);
5386 }
5380 5387
5381 stream = fopen (XSTRING (listfile)->data, "w"); 5388 stream = fopen (XSTRING (listfile)->data, "w");
5382 if (stream != NULL) 5389 if (stream != NULL)
5383 { 5390 {
5384 /* Arrange to close that file whether or not we get an error. 5391 /* Arrange to close that file whether or not we get an error.