From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id +CW1HSpOT2Vr+AAAG6o9tA:P1 (envelope-from ) for ; Sat, 11 Nov 2023 10:49:30 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id +CW1HSpOT2Vr+AAAG6o9tA (envelope-from ) for ; Sat, 11 Nov 2023 10:49:30 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 579E71680D for ; Sat, 11 Nov 2023 10:49:30 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=fabionatali.com header.s=gm1 header.b=LsEhbe5t; dmarc=pass (policy=reject) header.from=fabionatali.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1699696170; a=rsa-sha256; cv=none; b=gdG/v0Dsr+1O+sPLn84a+/waoks2htJClV+6Mgi0Fa5ft6TbPd8dA5JyxqNih5IRAyKlf7 AycxpIPgxjOR2jXQmoYrKfpE7FY8cn3iFKT7fotLY+35+LfKtex8n3zbRZk3dHYlU3hDKm ktjGXwZJY0RrOae/964b3Upo0VF49VtXM55SzylofkX/NmUQGUm4fGskreYe13wPz9103b TzrsHo0cv0NItEbWCjbKT4NgVspfm083bNAQRYmBCX/Tm8hly9rumMXzf32/iUl4Glh6GV SWpocHfKh6q64y88nFgDvWKfUtgwZYwBL+oVUdYz55AVc4Y/AB7uI/U5KuTHaw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=fabionatali.com header.s=gm1 header.b=LsEhbe5t; dmarc=pass (policy=reject) header.from=fabionatali.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1699696170; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=OFd/IY0Wis3d3i7CtfrvFiOPDQGbyllAQbItVyEwKEg=; b=tKKMginOQwfPXu8xUewi8tfaCooxnjkABgah7Pv/0vdkPMsMvEW9VFazobbW87JnD17kzS a1lwaAyJW9J75p4lU4hnxlBpv/6rEiV9vjlpnHmCZ65jdleTs4C8gWoGfT1m8tbomFOlXK Gn7i8Yu04gfnfJMF+jK6iW++M97u/1XL93zlTS0VhhNL3ZeHJpZopY8MeE2Jgwzkcz++Br 9iNCeTYuwhBIqUDAn65b++u4dQ23XdZ99JkF+N/GlQvTK6bqiscib2oUJScPOFI55FqKGX XgE6wuUuCpc22XZwTyYrJ8wXAs4VamLqV7vbYt7AMdIdVFh38JAVWrer4aShBg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1kbb-0004NS-Ff; Sat, 11 Nov 2023 04:48:43 -0500 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 1r1kbY-0004NK-RL for emacs-orgmode@gnu.org; Sat, 11 Nov 2023 04:48:40 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1kbV-00056P-5k for emacs-orgmode@gnu.org; Sat, 11 Nov 2023 04:48:40 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 2D250240002; Sat, 11 Nov 2023 09:48:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fabionatali.com; s=gm1; t=1699696114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OFd/IY0Wis3d3i7CtfrvFiOPDQGbyllAQbItVyEwKEg=; b=LsEhbe5tNxHB38j+fxUnGtVWXpaUN7E3dq6GA0gmDqfd29X/XVt9U/kMl96roELVa5prt9 25nZspnYz/lfyvMUHESYL1Xhrnsy+8SEqvOG2MZBTe3IGC0NlQl7tXue31ZdI+gpDQY1dD +ep276Cgm2IkwWA3b1kWXQ1/1dHZFkReGspoertWnHrCRZ6TyGG//vIEGKI+OYTds8eNyT XvBj/4rLwwwrtLy5b0BrK0ydORf37pYJWnFOC1PNlh48kLburICnAO93cySQ5ToiOwiMye 2KNTp5GnYw/t6bKkw806yt4fkI+jt0wvClQljZhE7CQDly0LR4lC0A416E9dGQ== From: Fabio Natali To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: Issue with org-persist and Tramp In-Reply-To: <87edgxhmry.fsf@fabionatali.com> References: <87jzqthdge.fsf@fabionatali.com> <87msvofvgx.fsf@localhost> <87a5roi1na.fsf@fabionatali.com> <87h6lw2kg9.fsf@localhost> <875y2chr1f.fsf@fabionatali.com> <8734xf2k9v.fsf@localhost> <87ttpvgjg5.fsf@fabionatali.com> <87r0ky0xi5.fsf@localhost> <87h6lthnds.fsf@fabionatali.com> <87edgxhmry.fsf@fabionatali.com> Date: Sat, 11 Nov 2023 09:48:33 +0000 Message-ID: <87bkc0y61a.fsf@fabionatali.com> MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: me@fabionatali.com Received-SPF: pass client-ip=217.70.183.193; envelope-from=me@fabionatali.com; helo=relay1-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 579E71680D X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -9.63 X-Spam-Score: -9.63 X-TUID: nF1aspR8v8oq On 2023-11-10, 11:26 +0000, Fabio Natali wrote: > On 2023-11-10, 11:13 +0000, Fabio Natali wrote: >> Brilliant. I think the second branch should read `(not (file-remote-p >> file))', i.e. `file' instead of `associated'? It seems to work with that >> micro amendment. > > Hm, I stand corrected, I retested it end-to-end and no, it doesn't seem > to work. I'll post more details later. Cheers, Fabio. Hi Ihor, Sorry for the delay. My results below, after testing a couple of different cases. If the remote file had been saved before losing connection, then the patch below will fix the problem. TRAMP will still hang for a while, as it tries to reach the server but the buffer will be closed immediately when using `tramp-cleanup-all-buffers' (or a variant thereof). --- /tmp/test-0.el 2023-11-11 09:27:33.477117451 +0000 +++ /tmp/test-1.el 2023-11-11 09:27:14.217129703 +0000 @@ -5,7 +5,8 @@ (unless (stringp associated) (setq associated (cadr associated))) (let* ((rtn `(:file ,associated)) - (inode (and (fboundp 'file-attribute-inode-number) + (inode (and (not (file-remote-p associated)) + (fboundp 'file-attribute-inode-number) (file-attribute-inode-number (file-attributes associated))))) (when inode (plist-put rtn :inode inode)) @@ -25,6 +26,7 @@ (or (buffer-base-buffer associated) associated))) (setq inode (when (and file + (not (file-remote-p file)) (fboundp 'file-attribute-inode-number)) (file-attribute-inode-number (file-attributes file)))) (Apologies, the patch is badly formatted and not meant for the repository.) The gist is that I replaced an occurrence of `associated' with `file' in your latest patch, Ihor. It seems to work, what do you think? However, if the remote file hadn't been saved, then TRAMP will still hang indefinitely. Quitting will reveal the following backtrace: Debugger entered--Lisp error: (quit "") signal(quit ("")) tramp-error(nil quit "") tramp-signal-hook-function(quit ("")) signal(quit ("")) tramp-maybe-open-connection((tramp-file-name "ssh" nil nil "192.168.1.100" nil "~/.#test.org" nil)) tramp-send-command((tramp-file-name "ssh" nil nil "192.168.1.100" nil "~/.#test.org" nil) "echo ~ 2>/dev/null; echo tramp_exit_status $?") tramp-send-command-and-check((tramp-file-name "ssh" nil nil "192.168.1.100" nil "~/.#test.org" nil) "echo ~") tramp-sh-handle-get-home-directory((tramp-file-name "ssh" nil nil "192.168.1.100" nil "~/.#test.org" nil) "") tramp-sh-file-name-handler(tramp-get-home-directory (tramp-file-name "ssh" nil nil "192.168.1.100" nil "~/.#test.org" nil) "") apply(tramp-sh-file-name-handler tramp-get-home-directory ((tramp-file-name "ssh" nil nil "192.168.1.100" nil "~/.#test.org" nil) "")) tramp-file-name-handler(tramp-get-home-directory (tramp-file-name "ssh" nil nil "192.168.1.100" nil "~/.#test.org" nil) "") tramp-get-home-directory((tramp-file-name "ssh" nil nil "192.168.1.100" nil "~/.#test.org" nil) "") tramp-sh-handle-expand-file-name("/ssh:192.168.1.100:~/.#test.org" nil) tramp-sh-file-name-handler(expand-file-name "/ssh:192.168.1.100:~/.#test.org" nil) apply(tramp-sh-file-name-handler expand-file-name ("/ssh:192.168.1.100:~/.#test.org" nil)) tramp-file-name-handler(expand-file-name "/ssh:192.168.1.100:~/.#test.org" nil) files--transform-file-name("/ssh:192.168.1.100:~/test.org" nil ".#" "") make-lock-file-name("/ssh:192.168.1.100:~/test.org") tramp-run-real-handler(make-lock-file-name ("/ssh:192.168.1.100:~/test.org")) tramp-handle-make-lock-file-name("/ssh:192.168.1.100:~/test.org") tramp-sh-file-name-handler(make-lock-file-name "/ssh:192.168.1.100:~/test.org") apply(tramp-sh-file-name-handler make-lock-file-name "/ssh:192.168.1.100:~/test.org") tramp-file-name-handler(make-lock-file-name "/ssh:192.168.1.100:~/test.org") tramp-compat-make-lock-file-name("/ssh:192.168.1.100:~/test.org") tramp-handle-unlock-file("/ssh:192.168.1.100:~/test.org") tramp-sh-file-name-handler(unlock-file "/ssh:192.168.1.100:~/test.org") apply(tramp-sh-file-name-handler unlock-file "/ssh:192.168.1.100:~/test.org") tramp-file-name-handler(unlock-file "/ssh:192.168.1.100:~/test.org") kill-buffer("test.org") funcall-interactively(kill-buffer "test.org") command-execute(kill-buffer) This seems to be on the TRAMP side? Cheers, Fabio.