]> git.eshelyaron.com Git - emacs.git/commitdiff
(auto-save-mode): If autosave is off because buffer has
authorRichard M. Stallman <rms@gnu.org>
Wed, 6 Jul 1994 21:41:47 +0000 (21:41 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 6 Jul 1994 21:41:47 +0000 (21:41 +0000)
shrunk, then toggling should turn it on.

lisp/files.el

index 5ae8af41e82e16a49ed82677605a1dec23139a0a..8982b4fd39612e3a773a14041c01c73d3ea254dc 100644 (file)
@@ -1949,7 +1949,10 @@ With prefix argument ARG, turn auto-saving on if positive, else off."
   (interactive "P")
   (setq buffer-auto-save-file-name
         (and (if (null arg)
-                (not buffer-auto-save-file-name)
+                (or (not buffer-auto-save-file-name)
+                    ;; If autosave is off because buffer has shrunk,
+                    ;; then toggling should turn it on.
+                    (< buffer-saved-size 0))
               (or (eq arg t) (listp arg) (and (integerp arg) (> arg 0))))
             (if (and buffer-file-name auto-save-visited-file-name
                      (not buffer-read-only))