diff --git a/configuration.org b/configuration.org index 98def4f..4510556 100644 --- a/configuration.org +++ b/configuration.org @@ -2149,7 +2149,7 @@ First, a function that turns off auto-saving for remote files. #+BEGIN_SRC emacs-lisp (defun gpolonkai/dont-autosave-remote () - (unless (file-remote-p (or (buffer-file-name) "")) + (when (and buffer-file-name (not (file-remote-p buffer-file-name))) (real-auto-save-mode))) #+END_SRC @@ -2157,8 +2157,10 @@ Then configure ~real-auto-save-mode~ #+BEGIN_SRC emacs-lisp (use-package real-auto-save + :demand t :hook - (text-mode . gpolonkai/dont-autosave-remote)) + (text-mode . gpolonkai/dont-autosave-remote) + (prog-mode . gpolonkai/dont-autosave-remote)) #+END_SRC ** Help merging ~pacsave~ and ~pacnew~ files