aboutsummaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorGerd Moellmann2001-05-31 09:59:12 +0000
committerGerd Moellmann2001-05-31 09:59:12 +0000
commit0894672ffabccfea2ddeb2d01bb27d12c4853191 (patch)
tree99f229aeb690be7a68f11fadc0b865ad6fbfb558 /src/fileio.c
parent94843cc1b16b244fc7989005d074c1e71d5a1865 (diff)
downloademacs-0894672ffabccfea2ddeb2d01bb27d12c4853191.tar.gz
emacs-0894672ffabccfea2ddeb2d01bb27d12c4853191.zip
(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.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 8b6c0bd165a..9987cbfd343 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5370,13 +5370,20 @@ A non-nil CURRENT-ONLY argument means save only current buffer.")
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)