diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-05-12 02:16:38 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-05-12 02:16:38 +0200 |
commit | 1642a5ffcdf734c629e5aec963a0b190997704d6 (patch) | |
tree | cbcd00919ab5f0c0d65ea6cd08fd77b3cf61414a /test/src/buffer-tests.el | |
parent | dce85743b6856132a64709cd191951f9d190ce6e (diff) | |
download | emacs-1642a5ffcdf734c629e5aec963a0b190997704d6.tar.gz |
Adjust restore-buffer-modified-p autosaved logic
* doc/lispref/buffers.texi (Buffer Modification): Adjust
documentation.
* src/buffer.c (Frestore_buffer_modified_p): Fix up the logic
around `autosaved': It means "the buffer is modified, and also
autosaved".
Diffstat (limited to 'test/src/buffer-tests.el')
-rw-r--r-- | test/src/buffer-tests.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el index 10dac68f9fe..f6a18acaa64 100644 --- a/test/src/buffer-tests.el +++ b/test/src/buffer-tests.el @@ -1515,6 +1515,16 @@ with parameters from the *Messages* buffer modification." (should (eq (buffer-modified-p) 'autosaved)) (insert "zot") (restore-buffer-modified-p 'autosaved) + (should (eq (buffer-modified-p) 'autosaved)))) + + (ert-with-temp-file file + (with-current-buffer (find-file file) + (auto-save-mode 1) + (should-not (buffer-modified-p)) + (insert "foo") + (should (buffer-modified-p)) + (should-not (eq (buffer-modified-p) 'autosaved)) + (restore-buffer-modified-p 'autosaved) (should (eq (buffer-modified-p) 'autosaved))))) ;;; buffer-tests.el ends here |