comparison lisp/files.el @ 8158:a6fa25ffa764

(auto-save-mode): If autosave is off because buffer has shrunk, then toggling should turn it on.
author Richard M. Stallman <rms@gnu.org>
date Wed, 06 Jul 1994 21:41:47 +0000
parents 14766204c0fe
children 1013d56a1133
comparison
equal deleted inserted replaced
8157:14766204c0fe 8158:a6fa25ffa764
1947 "Toggle auto-saving of contents of current buffer. 1947 "Toggle auto-saving of contents of current buffer.
1948 With prefix argument ARG, turn auto-saving on if positive, else off." 1948 With prefix argument ARG, turn auto-saving on if positive, else off."
1949 (interactive "P") 1949 (interactive "P")
1950 (setq buffer-auto-save-file-name 1950 (setq buffer-auto-save-file-name
1951 (and (if (null arg) 1951 (and (if (null arg)
1952 (not buffer-auto-save-file-name) 1952 (or (not buffer-auto-save-file-name)
1953 ;; If autosave is off because buffer has shrunk,
1954 ;; then toggling should turn it on.
1955 (< buffer-saved-size 0))
1953 (or (eq arg t) (listp arg) (and (integerp arg) (> arg 0)))) 1956 (or (eq arg t) (listp arg) (and (integerp arg) (> arg 0))))
1954 (if (and buffer-file-name auto-save-visited-file-name 1957 (if (and buffer-file-name auto-save-visited-file-name
1955 (not buffer-read-only)) 1958 (not buffer-read-only))
1956 buffer-file-name 1959 buffer-file-name
1957 (make-auto-save-file-name)))) 1960 (make-auto-save-file-name))))