diff src/fileio.c @ 95362:e886c765584a

* src/fileio.c (Fwrite_region): Delay the defaulting to beg&z to after calling build_annotations. * lisp/files.el (basic-save-buffer-2): Pass nil rather than (point-min) to write-region.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 28 May 2008 12:36:15 +0000
parents b3c07d035bed
children ddedcecb18ef
line wrap: on
line diff
--- a/src/fileio.c	Wed May 28 12:26:41 2008 +0000
+++ b/src/fileio.c	Wed May 28 12:36:15 2008 +0000
@@ -5079,8 +5079,11 @@
   /* Special kludge to simplify auto-saving.  */
   if (NILP (start))
     {
+      /* Do it later, so write-region-annotate-function can work differently
+	 if we save "the buffer" vs "a region".
+	 This is useful in tar-mode.  --Stef
       XSETFASTINT (start, BEG);
-      XSETFASTINT (end, Z);
+      XSETFASTINT (end, Z); */
       Fwiden ();
     }
 
@@ -5100,6 +5103,12 @@
 	}
     }
 
+  if (NILP (start))
+    {
+      XSETFASTINT (start, BEGV);
+      XSETFASTINT (end, ZV);
+    }
+
   UNGCPRO;
 
   GCPRO5 (start, filename, annotations, visit_file, lockname);