]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/fileio.c (Fwrite_region): Delay the defaulting to beg&z to after
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 28 May 2008 12:36:15 +0000 (12:36 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 28 May 2008 12:36:15 +0000 (12:36 +0000)
calling build_annotations.
* lisp/files.el (basic-save-buffer-2): Pass nil rather than (point-min)
to write-region.

lisp/ChangeLog
lisp/files.el
src/ChangeLog
src/fileio.c

index bf1a3e309fd757d2fec911f86c36789dce52203f..fc88bbc3c601f898d18c7acad8c70fd251784813 100644 (file)
@@ -1,3 +1,8 @@
+2008-05-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * files.el (basic-save-buffer-2): Pass nil rather than (point-min)
+       to write-region.
+
 2008-05-28  Glenn Morris  <rgm@gnu.org>
 
        * Makefile.in (update-elclist): Work around non-portability of "\"
index 9802f903eeb9ff074d5a763fba84725ba921a07e..14752752b79bc6b82fa0cf03a9495a7cfa431459 100644 (file)
@@ -4085,7 +4085,10 @@ Before and after saving the buffer, this function runs
                               (setq tempname
                                     (make-temp-name
                                      (expand-file-name "tmp" dir)))
-                              (write-region (point-min) (point-max)
+                               ;; Pass in nil&nil rather than point-min&max
+                               ;; cause we're saving the whole buffer.
+                               ;; write-region-annotate-functions may use it.
+                              (write-region nil nil
                                             tempname nil  realname
                                             buffer-file-truename 'excl)
                               nil)
@@ -4119,7 +4122,10 @@ Before and after saving the buffer, this function runs
        (let (success)
          (unwind-protect
              (progn
-               (write-region (point-min) (point-max)
+                ;; Pass in nil&nil rather than point-min&max to indicate
+                ;; we're saving the buffer rather than just a region.
+                ;; write-region-annotate-functions may make us of it.
+               (write-region nil nil
                              buffer-file-name nil t buffer-file-truename)
                (setq success t))
            ;; If we get an error writing the new file, and we made
index ef7acb97eb444f1a2037312eeed1bd7e8112b1b2..b4a3e74c453611f81832cbb335080890306f543c 100644 (file)
@@ -1,3 +1,8 @@
+2008-05-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * fileio.c (Fwrite_region): Delay the defaulting to beg&z to after
+       calling build_annotations.
+
 2008-05-28  Juanma Barranquero  <lekktu@gmail.com>
 
        * coding.c (Fdecode_coding_region, Fencode_coding_region)
index c4b0113523ae8057fe6d14d4a4f07f33bcf7d424..2a700a69f97a45ff912be006032f704e0696a5af 100644 (file)
@@ -5079,8 +5079,11 @@ This does code conversion according to the value of
   /* 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 @@ This does code conversion according to the value of
        }
     }
 
+  if (NILP (start))
+    {
+      XSETFASTINT (start, BEGV);
+      XSETFASTINT (end, ZV);
+    }
+
   UNGCPRO;
 
   GCPRO5 (start, filename, annotations, visit_file, lockname);