emacs-diffs
[Top][All Lists]
Advanced

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

master 453ffe5: Fix minor Tramp oddities


From: Michael Albinus
Subject: master 453ffe5: Fix minor Tramp oddities
Date: Wed, 20 May 2020 05:09:52 -0400 (EDT)

branch: master
commit 453ffe5d535438fba3d189cf26c47f25491d15fb
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Fix minor Tramp oddities
    
    * lisp/net/tramp-archive.el (tramp-archive-file-name-handler):
    Increase `max-specpdl-size' temporarily.
    
    * lisp/net/tramp-rclone.el (tramp-rclone-flush-directory-cache):
    Fix a problem with older Emacsen.
---
 lisp/net/tramp-archive.el |  5 ++++-
 lisp/net/tramp-rclone.el  | 13 ++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el
index 95cbfb8..63c0769 100644
--- a/lisp/net/tramp-archive.el
+++ b/lisp/net/tramp-archive.el
@@ -318,7 +318,10 @@ arguments to pass to the OPERATION."
 
       (let* ((filename (apply #'tramp-archive-file-name-for-operation
                              operation args))
-            (archive (tramp-archive-file-name-archive filename)))
+            (archive (tramp-archive-file-name-archive filename))
+            ;; Sometimes, it fails with "Variable binding depth exceeds
+            ;; max-specpdl-size".
+            (max-specpdl-size (* 2 max-specpdl-size)))
 
         ;; `filename' could be a quoted file name.  Or the file
         ;; archive could be a directory, see Bug#30293.
diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el
index 445098a..08bba33 100644
--- a/lisp/net/tramp-rclone.el
+++ b/lisp/net/tramp-rclone.el
@@ -477,7 +477,18 @@ file names."
           (with-tramp-connection-property
               (tramp-get-connection-process vec) "rclone-pid"
             (catch 'pid
-              (dolist (pid (list-system-processes)) ;; "pidof rclone" ?
+              (dolist
+                  (pid
+                   ;; Until Emacs 25, `process-attributes' could
+                   ;; crash Emacs for some processes.  So we use
+                   ;; "pidof", which might not work everywhere.
+                   (if (<= emacs-major-version 25)
+                       (let ((default-directory temporary-file-directory))
+                         (mapcar
+                          #'string-to-number
+                          (split-string
+                           (shell-command-to-string "pidof rclone"))))
+                     (list-system-processes)))
                 (and (string-match-p
                       (regexp-quote
                        (format "rclone mount %s:" (tramp-file-name-host vec)))



reply via email to

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