aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2022-07-05 14:16:08 +0200
committerStefan Kangas2022-07-05 14:51:21 +0200
commit3631355dcb97ccbf24dd7f7ca6efb97d78e0c511 (patch)
tree864fa93cccead600355eec7b2da994c079a37580
parentac7f76528f2f2e2f6e77bc25e7040eb3b07e45c0 (diff)
downloademacs-3631355dcb97ccbf24dd7f7ca6efb97d78e0c511.tar.gz
emacs-3631355dcb97ccbf24dd7f7ca6efb97d78e0c511.zip
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)
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/files.el8
2 files changed, 13 insertions, 0 deletions
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
2008You can use it to automatically save only specific buffers, for 2008You can use it to automatically save only specific buffers, for
2009example buffers using a particular mode or in some directory. 2009example buffers using a particular mode or in some directory.
2010 2010
2011---
2012*** New user option 'auto-save-visited-remote-files'.
2013This user option controls whether or not 'auto-save-visited-mode' will
2014save remote buffers. The default is t.
2015
2011+++ 2016+++
2012*** New package vtable.el for formatting tabular data. 2017*** New package vtable.el for formatting tabular data.
2013This package allows formatting data using variable-pitch fonts. 2018This 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."
468 :risky t 468 :risky t
469 :version "29.1") 469 :version "29.1")
470 470
471(defcustom auto-save-visited-remote-files t
472 "If non-nil, `auto-save-visited-mode' will save remote files."
473 :group 'auto-save
474 :type 'boolean
475 :version "29.1")
476
471(define-minor-mode auto-save-visited-mode 477(define-minor-mode auto-save-visited-mode
472 "Toggle automatic saving to file-visiting buffers on or off. 478 "Toggle automatic saving to file-visiting buffers on or off.
473 479
@@ -501,6 +507,8 @@ For more details, see Info node `(emacs) Auto Save Files'."
501 auto-save-visited-mode 507 auto-save-visited-mode
502 (not (and buffer-auto-save-file-name 508 (not (and buffer-auto-save-file-name
503 auto-save-visited-file-name)) 509 auto-save-visited-file-name))
510 (or (not (file-remote-p buffer-file-name))
511 auto-save-visited-remote-files)
504 (or (not (functionp auto-save-visited-predicate)) 512 (or (not (functionp auto-save-visited-predicate))
505 (funcall auto-save-visited-predicate)))))))) 513 (funcall auto-save-visited-predicate))))))))
506 514