From: Chong Yidong Date: Tue, 21 Jul 2009 23:34:33 +0000 (+0000) Subject: * mail/rmailedit.el (rmail-edit-mode): Use auto-save-include-big-deletions. X-Git-Tag: emacs-pretest-23.1.90~2074 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a4f6970146a1c329acba6e4301a713af85314841;p=emacs.git * mail/rmailedit.el (rmail-edit-mode): Use auto-save-include-big-deletions. * mail/rmail.el (rmail-variables): Use auto-save-include-big-deletions. * files.el (auto-save-mode): Revert 2009-07-21 and 2009-07-16 changes. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6d480f8d7d3..8f8e7694588 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2009-07-21 Chong Yidong + + * mail/rmailedit.el (rmail-edit-mode): Use + auto-save-include-big-deletions. + + * mail/rmail.el (rmail-variables): Use + auto-save-include-big-deletions. + + * files.el (auto-save-mode): Revert 2009-07-21 and 2009-07-16 + changes. + 2009-07-21 Jay Belanger * calc/calc.el (calc-undo-length): New variable. diff --git a/lisp/files.el b/lisp/files.el index 1528b380ff3..5f256a016ca 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -5005,7 +5005,7 @@ With prefix argument ARG, turn auto-saving on if positive, else off." (or (not buffer-auto-save-file-name) ;; If auto-save is off because buffer has shrunk, ;; then toggling should turn it on. - (= buffer-saved-size -1)) + (< 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)) @@ -5013,7 +5013,7 @@ With prefix argument ARG, turn auto-saving on if positive, else off." (make-auto-save-file-name)))) ;; If -1 was stored here, to temporarily turn off saving, ;; turn it back on. - (and (= buffer-saved-size -1) + (and (< buffer-saved-size 0) (setq buffer-saved-size 0)) (if (interactive-p) (message "Auto-save %s (in this buffer)" diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 3766b8d4be9..f6e7af38346 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -1412,7 +1412,8 @@ If so restore the actual mbox message collection." (setq local-enable-local-variables nil) ;; Don't turn off auto-saving based on the size of the buffer ;; because that code does not understand buffer-swapping. - (setq buffer-saved-size -2) + (make-local-variable 'auto-save-include-big-deletions) + (setq auto-save-include-big-deletions t) (make-local-variable 'revert-buffer-function) (setq revert-buffer-function 'rmail-revert) (make-local-variable 'font-lock-defaults) diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el index f63e6870a8f..d350c29006b 100644 --- a/lisp/mail/rmailedit.el +++ b/lisp/mail/rmailedit.el @@ -64,6 +64,10 @@ This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'. (if (boundp 'mode-line-modified) (setq mode-line-modified (default-value 'mode-line-modified)) (setq mode-line-format (default-value 'mode-line-format))) + ;; Don't turn off auto-saving based on the size of the buffer + ;; because that code does not understand buffer-swapping. + (make-local-variable 'auto-save-include-big-deletions) + (setq auto-save-include-big-deletions t) ;; If someone uses C-x C-s, don't clobber the rmail file (bug#2625). (add-hook 'write-region-annotate-functions 'rmail-write-region-annotate nil t)