emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/fileio.c


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/src/fileio.c
Date: Fri, 16 Nov 2001 20:24:02 -0500

Index: emacs/src/fileio.c
diff -u emacs/src/fileio.c:1.425 emacs/src/fileio.c:1.426
--- emacs/src/fileio.c:1.425    Fri Nov 16 09:49:20 2001
+++ emacs/src/fileio.c  Fri Nov 16 20:24:01 2001
@@ -4511,8 +4511,9 @@
   RETURN_UNGCPRO (unbind_to (count, val));
 }
 
-static Lisp_Object build_annotations P_ ((Lisp_Object, Lisp_Object,
-                                         Lisp_Object));
+static Lisp_Object build_annotations P_ ((Lisp_Object, Lisp_Object));
+static Lisp_Object build_annotations_2 P_ ((Lisp_Object, Lisp_Object,
+                                           Lisp_Object, Lisp_Object));
 
 /* If build_annotations switched buffers, switch back to BUF.
    Kill the temporary buffer that was selected in the meantime.
@@ -4705,7 +4706,7 @@
 
   filename = Fexpand_file_name (filename, Qnil);
 
-  if (! NILP (mustbenew) && !EQ (mustbenew, Qexcl))
+  if (!NILP (mustbenew) && !EQ (mustbenew, Qexcl))
     barf_or_query_if_file_exists (filename, "overwrite", 1, 0, 1);
 
   if (STRINGP (visit))
@@ -4714,8 +4715,6 @@
     visit_file = filename;
   UNGCPRO;
 
-  annotations = Qnil;
-
   if (NILP (lockname))
     lockname = visit_file;
 
@@ -4755,13 +4754,26 @@
   count1 = specpdl_ptr - specpdl;
 
   given_buffer = current_buffer;
-  annotations = build_annotations (start, end, coding.pre_write_conversion);
+  annotations = build_annotations (start, end);
   if (current_buffer != given_buffer)
     {
       XSETFASTINT (start, BEGV);
       XSETFASTINT (end, ZV);
     }
 
+  UNGCPRO;
+
+  GCPRO5 (start, filename, annotations, visit_file, lockname);
+
+  given_buffer = current_buffer;
+  annotations = build_annotations_2 (start, end,
+                                    coding.pre_write_conversion, annotations);
+  if (current_buffer != given_buffer)
+    {
+      XSETFASTINT (start, BEGV);
+      XSETFASTINT (end, ZV);
+    }
+
 #ifdef CLASH_DETECTION
   if (!auto_saving)
     {
@@ -5065,8 +5077,8 @@
    as save-excursion would do.  */
 
 static Lisp_Object
-build_annotations (start, end, pre_write_conversion)
-     Lisp_Object start, end, pre_write_conversion;
+build_annotations (start, end)
+     Lisp_Object start, end;
 {
   Lisp_Object annotations;
   Lisp_Object p, res;
@@ -5127,6 +5139,18 @@
        annotations = merge (annotations, res, Qcar_less_than_car);
     }
 
+  UNGCPRO;
+  return annotations;
+}
+
+static Lisp_Object
+build_annotations_2 (start, end, pre_write_conversion, annotations)
+     Lisp_Object start, end, pre_write_conversion, annotations;
+{
+  struct gcpro gcpro1;
+  Lisp_Object res;
+
+  GCPRO1 (annotations);
   /* At last, do the same for the function PRE_WRITE_CONVERSION
      implied by the current coding-system.  */
   if (!NILP (pre_write_conversion))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]