From 480060913c1cc91d8d977ff85bbdd93d23d173a6 Mon Sep 17 00:00:00 2001 From: Haruyasu Ueda Date: Thu, 7 May 2015 18:56:20 +0900 Subject: [PATCH] #11 save-buffer only if no change since vistted or saved. There still is risk to try to save-buffer just after changed, but it happens at most once. --- real-auto-save.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/real-auto-save.el b/real-auto-save.el index 90a5362..9d9faa9 100644 --- a/real-auto-save.el +++ b/real-auto-save.el @@ -82,8 +82,11 @@ (dolist (elem real-auto-save-alist) (set-buffer elem) (if (and (buffer-file-name) (buffer-modified-p)) - (save-buffer)))) - (real-auto-save-restart-timer))) + (if (verify-visited-file-modtime) + (save-buffer) + (message (format"%s has changed since visited or saved. Not saved automatically." elem))) + )) + (real-auto-save-restart-timer)))) (defun real-auto-save-remove-buffer-from-alist () "If a buffer is killed, remove it from real-auto-save-alist."