[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 3631355dcb 3/3: New user option auto-save-visited-remote-files
From: |
Stefan Kangas |
Subject: |
master 3631355dcb 3/3: New user option auto-save-visited-remote-files |
Date: |
Tue, 5 Jul 2022 08:57:14 -0400 (EDT) |
branch: master
commit 3631355dcb97ccbf24dd7f7ca6efb97d78e0c511
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
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)
---
etc/NEWS | 5 +++++
lisp/files.el | 8 ++++++++
2 files changed, 13 insertions(+)
diff --git a/etc/NEWS b/etc/NEWS
index 5926148648..c5f6987dcf 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 55c50c33b4..794305520d 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))))))))