aboutsummaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c36
1 files changed, 11 insertions, 25 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 769dc14e77d..53b989f52e2 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1,6 +1,7 @@
1/* File IO for GNU Emacs. 1/* File IO for GNU Emacs.
2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996,
3 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. 3 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -5820,13 +5821,13 @@ auto_save_1 ()
5820} 5821}
5821 5822
5822static Lisp_Object 5823static Lisp_Object
5823do_auto_save_unwind (stream) /* used as unwind-protect function */ 5824do_auto_save_unwind (arg) /* used as unwind-protect function */
5824 Lisp_Object stream; 5825 Lisp_Object arg;
5825{ 5826{
5827 FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer;
5826 auto_saving = 0; 5828 auto_saving = 0;
5827 if (!NILP (stream)) 5829 if (stream != NULL)
5828 fclose ((FILE *) (XFASTINT (XCAR (stream)) << 16 5830 fclose (stream);
5829 | XFASTINT (XCDR (stream))));
5830 return Qnil; 5831 return Qnil;
5831} 5832}
5832 5833
@@ -5871,8 +5872,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
5871 int auto_saved = 0; 5872 int auto_saved = 0;
5872 int do_handled_files; 5873 int do_handled_files;
5873 Lisp_Object oquit; 5874 Lisp_Object oquit;
5874 FILE *stream; 5875 FILE *stream = NULL;
5875 Lisp_Object lispstream;
5876 int count = SPECPDL_INDEX (); 5876 int count = SPECPDL_INDEX ();
5877 int orig_minibuffer_auto_raise = minibuffer_auto_raise; 5877 int orig_minibuffer_auto_raise = minibuffer_auto_raise;
5878 int old_message_p = 0; 5878 int old_message_p = 0;
@@ -5924,24 +5924,10 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
5924 } 5924 }
5925 5925
5926 stream = fopen (SDATA (listfile), "w"); 5926 stream = fopen (SDATA (listfile), "w");
5927 if (stream != NULL)
5928 {
5929 /* Arrange to close that file whether or not we get an error.
5930 Also reset auto_saving to 0. */
5931 lispstream = Fcons (Qnil, Qnil);
5932 XSETCARFASTINT (lispstream, (EMACS_UINT)stream >> 16);
5933 XSETCDRFASTINT (lispstream, (EMACS_UINT)stream & 0xffff);
5934 }
5935 else
5936 lispstream = Qnil;
5937 }
5938 else
5939 {
5940 stream = NULL;
5941 lispstream = Qnil;
5942 } 5927 }
5943 5928
5944 record_unwind_protect (do_auto_save_unwind, lispstream); 5929 record_unwind_protect (do_auto_save_unwind,
5930 make_save_value (stream, 0));
5945 record_unwind_protect (do_auto_save_unwind_1, 5931 record_unwind_protect (do_auto_save_unwind_1,
5946 make_number (minibuffer_auto_raise)); 5932 make_number (minibuffer_auto_raise));
5947 minibuffer_auto_raise = 0; 5933 minibuffer_auto_raise = 0;