(when auto-save--timer
(timer-set-idle-time auto-save--timer value :repeat))))
+(defcustom auto-save-visited-predicate nil
+ "Predicate function for `auto-save-visited-mode'.
+
+If non-nil, the value should be a function of no arguments; it
+will be called once in each file-visiting buffer when the time
+comes to auto-save. A buffer will be saved only if the predicate
+function returns a non-nil value.
+
+For example, you could add this to your Init file to only save
+files that are both in Org mode and in a particular directory:
+
+ (setq auto-save-visited-predicate
+ (lambda () (and (eq major-mode \\='org-mode)
+ (string-match \"^/home/skangas/org/\"
+ buffer-file-name))))
+
+If the value of this variable is not a function, it is ignored.
+This is the same as having a predicate that always returns
+non-nil."
+ :group 'auto-save
+ :type '(choice :tag "Function:"
+ (const :tag "No extra predicate" :value nil)
+ (function :tag "Predicate function" :value always))
+ :risky t
+ :version "29.1")
+
+(defcustom remote-file-name-inhibit-auto-save-visited nil
+ "When nil, `auto-save-visited-mode' will auto-save remote files.
+Any other value means that it will not."
+ :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.
+ "Toggle automatic saving of file-visiting buffers to their files.
- When this mode is enabled, visited files are saved automatically.
- The user option `auto-save-visited-interval' controls how often.
+ 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.
- 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.
+ 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