From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: How to switch off autobackup for files loaded from tramp? Date: Tue, 30 Jan 2024 10:21:40 +0100 Message-ID: <87r0hztbvf.fsf@ledu-giraud.fr> References: <87o7d4dlb5.fsf@ledu-giraud.fr> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11306"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: help-gnu-emacs@gnu.org To: Steinar Bang Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 30 10:22:33 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 1rUkK8-0002hU-NC for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 30 Jan 2024 10:22:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUkJR-0007PI-Pn; Tue, 30 Jan 2024 04:21:50 -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 1rUkJP-0007PA-50 for help-gnu-emacs@gnu.org; Tue, 30 Jan 2024 04:21:47 -0500 Original-Received: from ledu-giraud.fr ([51.159.28.247]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUkJM-0004Yl-Po for help-gnu-emacs@gnu.org; Tue, 30 Jan 2024 04:21:46 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=JscC/5I0 6SCk10f5BqZVy+rYSnztFjV+R0AO+AKJJrI=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=DITaKCNXtl1tQwLY5XP6Rh+JObkHPk /6NLt6DyyvmSzEZBZ0/zRT7567SqJSFeZZU6PpfCg3B4Iyc35NZZYkAw== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=JscC/5I06SCk10f5 BqZVy+rYSnztFjV+R0AO+AKJJrI=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=vJhjZUpw7P3CZjmO5pJv31kyuSnviUgsq8uxDB 4/PcrVobCjVZZXAcjbVOBOK4ri1byxj/UHeVY6+Cbt/m3pXJJRoiK7LY6aaGVsqW3gkAUJ SSAUXUsP408ccxz/bdYnoxc3gZofkIDTeT+0nWUNUVSpcoMhwPBqMyP3raK8G6AJWsvfTG yJrnSkgVU9tWsQneuQmujg7mKcWIEHeGb+WJ3oAeX62RswaMri3BJClT9ReypHBoBy+SBA RM4Qm9u5dSEk0zlvRqsVuA8NvWMcGs2lkWNvn39I3ONpsSUKftIXJu95cC9vBpsYlHVH2N OXjyz09D61ABhoJE0JiIz2LA== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id e758eb79 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 30 Jan 2024 10:21:41 +0100 (CET) In-Reply-To: (Steinar Bang's message of "Tue, 30 Jan 2024 09:13:29 +0100") Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; helo=ledu-giraud.fr 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_PASS=-0.001, SPF_PASS=-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:145822 Archived-At: Steinar Bang writes: >>>>>> Manuel Giraud via Users list for the GNU Emacs text editor : > >> I have this in my init file: > >> (setq backup-enable-predicate >> (lambda (name) >> (and (normal-backup-enable-predicate name) >> (not (file-remote-p name))))) > > Thanks! This looked good and from the variable and function > documentation it really looked like it should work. > > Unfortunately it didn't... emacs still autosaves for me a file loaded > with tramp over a plink (putty SSH) connection. Hi, It is expected. Autosaves and backups are two differents things (I thought you were talking about backups). Backups is about keeping a copy(ies) of previous version of your file *at saving time* and autosaves is about keeping the modifications you've made *until you save* them. You could read for more details in the info Emacs manual. > Some versions: > GNU Emacs 29.1 (build 2, x86_64-w64-mingw32) of 2023-07-31 (windows 11 enterprise) > tramp version 2.6.0.29.1 > > Are there good ways to debug this in an "offending" buffer (ie. a buffer > holding a modified remote file)? > > I.e. how to I check what the predicate returns in this buffer? > > How do I check what (normal-backup-enable-predicate name) returns in > this buffer? > > How do I check what (file-remote-p name) returns in this buffer? You could do: M-: (normal-backup-enable-predicate (buffer-file-name)) and M-: (file-remote-p (buffer-file-name)) But it won't help you for autosaves ;-). You should read the corresponding section in the Emacs manual. Best regards, -- Manuel Giraud