]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix minor Tramp oddities
authorMichael Albinus <michael.albinus@gmx.de>
Wed, 20 May 2020 09:09:44 +0000 (11:09 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Wed, 20 May 2020 09:09:44 +0000 (11:09 +0200)
* 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
lisp/net/tramp-rclone.el

index 95cbfb8c22a6727fa6ac56f5e0f34dacb341ced7..63c0769e309dc8ceec42f344944d36fd499233ac 100644 (file)
@@ -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.
index 445098a5bca10246723947944feb1c12dab01a36..08bba33afed1756d0cdfe40f99c29d657ad9f916 100644 (file)
@@ -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)))