From ce1126ab75ae63143ae71b7ab4c232f2c5fcb3a7 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Mon, 19 Nov 2018 09:45:45 +0100 Subject: [PATCH] Configure usage of the real-auto-save package --- configuration.org | 21 +++++++++++++++++++++ customizations.el | 1 + 2 files changed, 22 insertions(+) diff --git a/configuration.org b/configuration.org index 597d6b5..44a0575 100644 --- a/configuration.org +++ b/configuration.org @@ -2139,6 +2139,27 @@ pattern to look for). If it is active, it will disable it." ("C-o" . gpolonkai/toggle-loccur))) #+END_SRC +** More fine-tuned autosaving +:PROPERTIES: +:SOURCE: https://www.reddit.com/r/emacs/comments/9vmljb/what_do_you_have_bound_to_mn_and_mp/e9elldc/ +:END: + +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) "")) + (real-auto-save-mode))) +#+END_SRC + +Then configure ~real-auto-save-mode~ + +#+BEGIN_SRC emacs-lisp +(use-package real-auto-save + :hook + (text-mode . gpolonkai/dont-autosave-remote)) +#+END_SRC + * Make programming a bit easier ** Electric case diff --git a/customizations.el b/customizations.el index 27e70c3..96de5da 100644 --- a/customizations.el +++ b/customizations.el @@ -161,6 +161,7 @@ pyvenv rainbow-delimiters rainbow-mode + real-auto-save restclient restclient-helm s