Don't try to save files when you don't have the permissions to do so
This commit is contained in:
parent
d7d3a8fc36
commit
4b907b9620
1 changed files with 2 additions and 1 deletions
|
@ -148,7 +148,8 @@ Will only occur if prelude-whitespace is also enabled."
|
||||||
"Save the current buffer if `prelude-auto-save' is not nil."
|
"Save the current buffer if `prelude-auto-save' is not nil."
|
||||||
(when (and prelude-auto-save
|
(when (and prelude-auto-save
|
||||||
buffer-file-name
|
buffer-file-name
|
||||||
(buffer-modified-p (current-buffer)))
|
(buffer-modified-p (current-buffer))
|
||||||
|
(file-writable-p buffer-file-name))
|
||||||
(save-buffer)))
|
(save-buffer)))
|
||||||
|
|
||||||
(defadvice switch-to-buffer (before save-buffer-now activate)
|
(defadvice switch-to-buffer (before save-buffer-now activate)
|
||||||
|
|
Loading…
Reference in a new issue