From: Stefan Kangas Date: Tue, 5 Jul 2022 12:16:08 +0000 (+0200) Subject: New user option auto-save-visited-remote-files X-Git-Tag: emacs-29.0.90~1447^2~1173 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3631355dcb97ccbf24dd7f7ca6efb97d78e0c511;p=emacs.git New user option auto-save-visited-remote-files * lisp/files.el (auto-save-visited-remote-files): New user option. (auto-save-visited-mode): Use above new variable to decide whether or not to save remote files. (Bug#41333) --- diff --git a/etc/NEWS b/etc/NEWS index 5926148648b..c5f6987dcf0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2008,6 +2008,11 @@ This user option is a predicate function which is called by You can use it to automatically save only specific buffers, for example buffers using a particular mode or in some directory. +--- +*** New user option 'auto-save-visited-remote-files'. +This user option controls whether or not 'auto-save-visited-mode' will +save remote buffers. The default is t. + +++ *** New package vtable.el for formatting tabular data. This package allows formatting data using variable-pitch fonts. diff --git a/lisp/files.el b/lisp/files.el index 55c50c33b4d..794305520db 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -468,6 +468,12 @@ true." :risky t :version "29.1") +(defcustom auto-save-visited-remote-files t + "If non-nil, `auto-save-visited-mode' will save remote files." + :group 'auto-save + :type 'boolean + :version "29.1") + (define-minor-mode auto-save-visited-mode "Toggle automatic saving to file-visiting buffers on or off. @@ -501,6 +507,8 @@ For more details, see Info node `(emacs) Auto Save Files'." auto-save-visited-mode (not (and buffer-auto-save-file-name auto-save-visited-file-name)) + (or (not (file-remote-p buffer-file-name)) + auto-save-visited-remote-files) (or (not (functionp auto-save-visited-predicate)) (funcall auto-save-visited-predicate))))))))