From 74b9c2afd86677637b905170848ae92cb6c1e943 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 6 Jul 1994 21:41:47 +0000 Subject: [PATCH] (auto-save-mode): If autosave is off because buffer has shrunk, then toggling should turn it on. --- lisp/files.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/files.el b/lisp/files.el index 5ae8af41e82..8982b4fd396 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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)) -- 2.39.5