Don't try to save files when you don't have the permissions to do so

This commit is contained in:
Bozhidar Batsov 2013-05-08 13:52:20 +03:00
parent d7d3a8fc36
commit 4b907b9620

View file

@ -148,7 +148,8 @@ Will only occur if prelude-whitespace is also enabled."
"Save the current buffer if `prelude-auto-save' is not nil."
(when (and prelude-auto-save
buffer-file-name
(buffer-modified-p (current-buffer)))
(buffer-modified-p (current-buffer))
(file-writable-p buffer-file-name))
(save-buffer)))
(defadvice switch-to-buffer (before save-buffer-now activate)