Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
halueda committed May 7, 2015
1 parent c49561f commit 4800609
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions real-auto-save.el
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 4800609

Please sign in to comment.