X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/b016179b58efb59ba177cafdaea6bdee2d23e0e0..d749b6fa2137756b292cf35fceafb80c15e89982:/src/fileio.c diff --git a/src/fileio.c b/src/fileio.c index 898dc0705d..53ae967e28 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -1,6 +1,7 @@ /* File IO for GNU Emacs. - Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, + 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -16,8 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #include @@ -5818,13 +5819,13 @@ auto_save_1 () } static Lisp_Object -do_auto_save_unwind (stream) /* used as unwind-protect function */ - Lisp_Object stream; +do_auto_save_unwind (arg) /* used as unwind-protect function */ + Lisp_Object arg; { + FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer; auto_saving = 0; - if (!NILP (stream)) - fclose ((FILE *) (XFASTINT (XCAR (stream)) << 16 - | XFASTINT (XCDR (stream)))); + if (stream != NULL) + fclose (stream); return Qnil; } @@ -5869,8 +5870,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) int auto_saved = 0; int do_handled_files; Lisp_Object oquit; - FILE *stream; - Lisp_Object lispstream; + FILE *stream = NULL; int count = SPECPDL_INDEX (); int orig_minibuffer_auto_raise = minibuffer_auto_raise; int old_message_p = 0; @@ -5922,24 +5922,10 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) } stream = fopen (SDATA (listfile), "w"); - if (stream != NULL) - { - /* Arrange to close that file whether or not we get an error. - Also reset auto_saving to 0. */ - lispstream = Fcons (Qnil, Qnil); - XSETCARFASTINT (lispstream, (EMACS_UINT)stream >> 16); - XSETCDRFASTINT (lispstream, (EMACS_UINT)stream & 0xffff); - } - else - lispstream = Qnil; - } - else - { - stream = NULL; - lispstream = Qnil; } - record_unwind_protect (do_auto_save_unwind, lispstream); + record_unwind_protect (do_auto_save_unwind, + make_save_value (stream, 0)); record_unwind_protect (do_auto_save_unwind_1, make_number (minibuffer_auto_raise)); minibuffer_auto_raise = 0;