]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow inhibiting 'auto-save-visited-mode' on a per-buffer basis.
authorPhilipp Stephani <phst@google.com>
Wed, 1 Apr 2020 17:54:01 +0000 (19:54 +0200)
committerPhilipp Stephani <phst@google.com>
Mon, 25 May 2020 19:11:59 +0000 (21:11 +0200)
At least for me, 'auto-save-visited-mode' is very slow and blocks user
interaction for files visited over TRAMP.  Therefore, I'd like a
mechanism to disable it for some buffers (namely, those visiting
remote files).

* (auto-save-visited-mode): Document that 'auto-save-visited-mode' can
be set to nil buffer-locally.

* etc/NEWS: Document new behavior.

etc/NEWS
lisp/files.el

index 4bc00cc3375dc19ba7abaafbefe1fc44b7b6920c..e09f32a7c3513f17259c1d4c3d1290f72f009717 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -98,6 +98,9 @@ shows equivalent key bindings for all commands that have them.
 'gomoku-move-sw' and 'gomoku-move-ne' now work correctly, and
 horizontal movements now stop at the edge of the board.
 
+** Autosaving via 'auto-save-visited-mode' can now be inhibited by
+setting the variable 'auto-save-visited-mode' buffer-locally to nil.
+
 \f
 * Changes in Specialized Modes and Packages in Emacs 28.1
 
index dba704f7a4b9a5f9f838c0de1f370ea1231cafa6..cb370476496855cc9e86fba62fa897504c5ceb6d 100644 (file)
@@ -430,7 +430,13 @@ idle for `auto-save-visited-interval' seconds."
 
 Unlike `auto-save-mode', this mode will auto-save buffer contents
 to the visited files directly and will also run all save-related
-hooks.  See Info node `Saving' for details of the save process."
+hooks.  See Info node `Saving' for details of the save process.
+
+You can also set the buffer-local value of the variable
+`auto-save-visted-mode' to nil.  A buffer where the buffer-local
+value of this variable is nil is ignored for the purpose of
+`auto-save-visited-mode', even if `auto-save-visited-mode' is
+enabled."
   :group 'auto-save
   :global t
   (when auto-save--timer (cancel-timer auto-save--timer))
@@ -441,6 +447,7 @@ hooks.  See Info node `Saving' for details of the save process."
            #'save-some-buffers :no-prompt
            (lambda ()
              (and buffer-file-name
+                  auto-save-visited-mode
                   (not (and buffer-auto-save-file-name
                             auto-save-visited-file-name))))))))