From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Steinar Bang Newsgroups: gmane.emacs.help Subject: Re: How to switch off autobackup for files loaded from tramp? Date: Tue, 30 Jan 2024 13:13:59 +0100 Message-ID: References: <87o7d4dlb5.fsf@ledu-giraud.fr> <87r0hztbvf.fsf@ledu-giraud.fr> <87eddzcfso.fsf@dod.no> <87wmrrf7n8.fsf@ledu-giraud.fr> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14913"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 30 13:14:43 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rUn0j-0003dh-9o for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 30 Jan 2024 13:14:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUn0A-00077g-WD; Tue, 30 Jan 2024 07:14:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUn07-000773-FE for help-gnu-emacs@gnu.org; Tue, 30 Jan 2024 07:14:03 -0500 Original-Received: from schwantz.bang.priv.no ([95.217.129.251]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUn04-0005eH-Ap for help-gnu-emacs@gnu.org; Tue, 30 Jan 2024 07:14:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dod.no; s=sb; t=1706616834; bh=zkJyH1DQtBY8J6ut6AcIf5s4082VCPbrHUFkXjmOfsw=; h=From:To:Subject:In-Reply-To:References:Date:From; b=VVFIMC/2mBGvUa784WJhtboBXksF8Q8QY4/5aY5UkbmdgC2EgeFkgkXZujRmeGMAv TvMbf0lmIVD94UoTdu6SLwXUKG45qBnYmeIpSi5bGy0LdcIIUJs61a9qMGn0UENrFz GmzN5rIK4m84tOFsEbt6Q+nXDhjk5XWHb6f1vFdI= Original-Received: from AAP-5CG32757DH (unknown [84.210.69.52]) by schwantz.bang.priv.no (Postfix) with ESMTPSA id 163B7429 for ; Tue, 30 Jan 2024 12:13:54 +0000 (UTC) In-Reply-To: (Steinar Bang's message of "Tue, 30 Jan 2024 12:53:52 +0100") Received-SPF: none client-ip=95.217.129.251; envelope-from=sb@dod.no; helo=schwantz.bang.priv.no X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145827 Archived-At: >>>>> Steinar Bang : >> 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