emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals-release/org 866e638c21: org-persist--normalize-associat


From: ELPA Syncer
Subject: [elpa] externals-release/org 866e638c21: org-persist--normalize-associated: Avoid TRAMP connection for remote files
Date: Sat, 11 Nov 2023 06:58:16 -0500 (EST)

branch: externals-release/org
commit 866e638c214857b92d647d8940c5a73bebfbdc18
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    org-persist--normalize-associated: Avoid TRAMP connection for remote files
    
    * lisp/org-persist.el (org-persist--normalize-associated): Never try
    to store inode association for remote TRAMP files.
    
    Reported-by: Fabio Natali <me@fabionatali.com>
    Link: https://orgmode.org/list/87jzqthdge.fsf@fabionatali.com
---
 lisp/org-persist.el | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/lisp/org-persist.el b/lisp/org-persist.el
index 01078f4596..65e9f4b7f1 100644
--- a/lisp/org-persist.el
+++ b/lisp/org-persist.el
@@ -481,9 +481,14 @@ MISC, if non-nil will be appended to the collection.  It 
must be a plist."
      (unless (stringp associated)
        (setq associated (cadr associated)))
      (let* ((rtn `(:file ,associated))
-            (inode (and (fboundp 'file-attribute-inode-number)
-                        (file-attribute-inode-number
-                         (file-attributes associated)))))
+            (inode (and
+                    ;; Do not store :inode for remote files - it may
+                    ;; be time-consuming on slow connections or even
+                    ;; fail completely when ssh connection is closed.
+                    (not (file-remote-p associated))
+                    (fboundp 'file-attribute-inode-number)
+                    (file-attribute-inode-number
+                     (file-attributes associated)))))
        (when inode (plist-put rtn :inode inode))
        rtn))
     ((or (pred bufferp) `(:buffer ,_))
@@ -501,6 +506,10 @@ MISC, if non-nil will be appended to the collection.  It 
must be a plist."
                      (or (buffer-base-buffer associated)
                          associated)))
          (setq inode (when (and file
+                                ;; Do not store :inode for remote files - it 
may
+                                ;; be time-consuming on slow connections or 
even
+                                ;; fail completely when ssh connection is 
closed.
+                                (not (file-remote-p file))
                                 (fboundp 'file-attribute-inode-number))
                        (file-attribute-inode-number
                         (file-attributes file))))



reply via email to

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