help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to switch off autobackup for files loaded from tramp?


From: Steinar Bang
Subject: Re: How to switch off autobackup for files loaded from tramp?
Date: Tue, 30 Jan 2024 13:13:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

>>>>> Steinar Bang <sb@dod.no>:

>> But... rummaging through emacs' files.el that 'C-h v' sent me to, I
>> found this:

>> (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")

>> I'll try using this.

> Ok, this was weird:
>     M-x : remote-file-name-inhibit-auto-save-visited
> in a buffer loaded from remote returns now t, but the buffer still
> autosaves when modified

> Does tramp do its own thing wrt to autosaving?

> Or isn't the tramp file recognized as a remote file?

The problem wasn't the autosave, the problem was that there was a lock
file created on the remote.

So this in my emacs now works on emacs 29:
    ;; Avoid doing autosaves when modifying remote files
    (setq remote-file-name-inhibit-locks t)
    ;(setq remote-file-name-inhibit-auto-save-visited t)
    (setq auto-save-visited-predicate (lambda () (not (file-remote-p 
buffer-file-name))))

The reason I use auto-save-visited-predicate is that I still use emacs
28 some places, and remote-file-name-inhibit-auto-save-visited only came
with emacs 29.

When I am on emacs 29 (or later) everywhere I will replace using
auto-save-visited-predicate with remote-file-name-inhibit-auto-save-visited




reply via email to

[Prev in Thread] Current Thread [Next in Thread]