Mercurial > emacs
comparison src/fileio.c @ 11632:ddbe0702ea95
(Fdo_auto_save): Record visited file name
as well as auto-save file name in the auto-save-list-file-name file.
Call Fexpand_file_name for auto-save-list-file-name.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 30 Apr 1995 19:50:56 +0000 |
parents | 51bc10be0dc7 |
children | 304577bc9b51 |
comparison
equal
deleted
inserted
replaced
11631:f9170a6c2e6f | 11632:ddbe0702ea95 |
---|---|
3794 if (!NILP (Vrun_hooks)) | 3794 if (!NILP (Vrun_hooks)) |
3795 call1 (Vrun_hooks, intern ("auto-save-hook")); | 3795 call1 (Vrun_hooks, intern ("auto-save-hook")); |
3796 | 3796 |
3797 if (STRINGP (Vauto_save_list_file_name)) | 3797 if (STRINGP (Vauto_save_list_file_name)) |
3798 { | 3798 { |
3799 Lisp_Object listfile; | |
3800 listfile = Fexpand_file_name (Vauto_save_list_file_name, Qnil); | |
3799 #ifdef DOS_NT | 3801 #ifdef DOS_NT |
3800 listdesc = open (XSTRING (Vauto_save_list_file_name)->data, | 3802 listdesc = open (XSTRING (listfile)->data, |
3801 O_WRONLY | O_TRUNC | O_CREAT | O_TEXT, | 3803 O_WRONLY | O_TRUNC | O_CREAT | O_TEXT, |
3802 S_IREAD | S_IWRITE); | 3804 S_IREAD | S_IWRITE); |
3803 #else /* not DOS_NT */ | 3805 #else /* not DOS_NT */ |
3804 listdesc = creat (XSTRING (Vauto_save_list_file_name)->data, 0666); | 3806 listdesc = creat (XSTRING (listfile)->data, 0666); |
3805 #endif /* not DOS_NT */ | 3807 #endif /* not DOS_NT */ |
3806 } | 3808 } |
3807 else | 3809 else |
3808 listdesc = -1; | 3810 listdesc = -1; |
3809 | 3811 |
3821 { | 3823 { |
3822 buf = XCONS (XCONS (tail)->car)->cdr; | 3824 buf = XCONS (XCONS (tail)->car)->cdr; |
3823 b = XBUFFER (buf); | 3825 b = XBUFFER (buf); |
3824 | 3826 |
3825 /* Record all the buffers that have auto save mode | 3827 /* Record all the buffers that have auto save mode |
3826 in the special file that lists them. */ | 3828 in the special file that lists them. For each of these buffers, |
3829 Record visited name (if any) and auto save name. */ | |
3827 if (STRINGP (b->auto_save_file_name) | 3830 if (STRINGP (b->auto_save_file_name) |
3828 && listdesc >= 0 && do_handled_files == 0) | 3831 && listdesc >= 0 && do_handled_files == 0) |
3829 { | 3832 { |
3833 if (!NILP (b->filename)) | |
3834 { | |
3835 write (listdesc, XSTRING (b->filename)->data, | |
3836 XSTRING (b->filename)->size); | |
3837 } | |
3838 write (listdesc, "\n", 1); | |
3830 write (listdesc, XSTRING (b->auto_save_file_name)->data, | 3839 write (listdesc, XSTRING (b->auto_save_file_name)->data, |
3831 XSTRING (b->auto_save_file_name)->size); | 3840 XSTRING (b->auto_save_file_name)->size); |
3832 write (listdesc, "\n", 1); | 3841 write (listdesc, "\n", 1); |
3833 } | 3842 } |
3834 | 3843 |