[Top][All Lists]

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

bug#31022: 27.0.50; darwin: Infinite recursion in tramp-file-name-handle

From: Michael Albinus
Subject: bug#31022: 27.0.50; darwin: Infinite recursion in tramp-file-name-handler
Date: Mon, 02 Apr 2018 20:05:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Simon Leinen <address@hidden> writes:

Hi Simon,

Thanks for the bug report.

> From a drawin host, visit a file on a non-darwin remote host via tramp,
> using C-x C-f /sshx:HOST:/DIR/FILE
> From that buffer, try to visit another file on that same host, or simply
> trigger file name completion by typing e.g. C-x C-f TAB
> Instead of the desired result, you will see an error message such as
>   tramp-file-name-handler: Lisp nesting exceeds ‘max-lisp-eval-depth’
> The problem here is that tramp ((TRAMP-COMPAT-TEMPORARY-FILE-DIRECTORY))
> evaluates the standard value of TEMPORARY-FILE-DIRECTORY (defined in
> cus-start.el), which calls SHELL-COMMAND-TO-STRING on the remote system,
> and also FILE-DIRECTORY-P, which will be replaced by tramp's version on
> the remote system.  My remote systems are GNU/Linux, not Darwin, and the
> "getconf DARWIN_USER_TEMP_DIR" command returns
> "getconf: Unrecognized variable `DARWIN_USER_TEMP_DIR'"
> According to a comment in cus-start.el, the FILE-DIRECTORY-P should
> handle that case:
>                                ;; Handles "getconf: Unrecognized variable..."
>                                (file-directory-p tmp)
> ...but in the remote case, FILE-DIRECTORY-P will end up recursively
> TRAMP-MODE around its evaluation of the TEMPORARY-FILE-DIRECTORY
> expression:

That would be an option, yes. But I prefer to fix it at the place the
problem happens, in cus-start.el.

Does the following patch cures the problem?

diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 9ba1e105a1..f31d1df309 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -277,9 +277,10 @@ minibuffer-prompt-properties--setter
                     ((eq system-type 'darwin)
                      (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
                          ;; See bug#7135.
-                         (let ((tmp (ignore-errors
-                                      (shell-command-to-string
-                                       "getconf DARWIN_USER_TEMP_DIR"))))
+                         (let* (file-name-handler-alist
+                                (tmp (ignore-errors
+                                       (shell-command-to-string
+                                        "getconf DARWIN_USER_TEMP_DIR"))))
                            (and (stringp tmp)
                                 (setq tmp (replace-regexp-in-string
                                            "\n\\'" "" tmp))
Best regards, Michael.

reply via email to

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