Variable: auto-save-visited-mode
auto-save-visited-mode is a customizable variable defined in
files.el.gz.
Value
nil
Documentation
Non-nil if Auto-Save-Visited mode is enabled.
See the auto-save-visited-mode(var)/auto-save-visited-mode(fun) command
for a description of this minor mode.
Setting this variable directly does not take effect;
either customize it (see the info node (emacs)Easy Customization)
or call the function auto-save-visited-mode(var)/auto-save-visited-mode(fun).
Probably introduced at or before Emacs version 26.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/files.el.gz
(define-minor-mode auto-save-visited-mode
"Toggle automatic saving of file-visiting buffers to their files.
When this mode is enabled, file-visiting buffers are automatically
saved to their files. This is in contrast to `auto-save-mode', which
auto-saves those buffers to a separate file, leaving the original
file intact. See Info node `Saving' for details of the save process.
The user option `auto-save-visited-interval' controls how often to
auto-save a buffer into its visited file.
You can use `auto-save-visited-predicate' to control which
buffers are saved.
You can also set the buffer-local value of the variable
`auto-save-visited-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.
For more details, see Info node `(emacs) Auto Save Files'."
:group 'auto-save
:global t
(when auto-save--timer (cancel-timer auto-save--timer))
(setq auto-save--timer
(when auto-save-visited-mode
(run-with-idle-timer
auto-save-visited-interval :repeat
#'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))
(or (not (file-remote-p buffer-file-name))
(not remote-file-name-inhibit-auto-save-visited))
(or (not (functionp auto-save-visited-predicate))
(funcall auto-save-visited-predicate))))))))