diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/net/tramp-sh.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 15 |
2 files changed, 12 insertions, 5 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 3ba3d956efc..2fb5566a3bf 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -4634,7 +4634,7 @@ Goes through the list `tramp-inline-compress-commands'." | |||
| 4634 | ;; host name in their command template. In this case, the remote | 4634 | ;; host name in their command template. In this case, the remote |
| 4635 | ;; file name must use either a local host name (first hop), or a | 4635 | ;; file name must use either a local host name (first hop), or a |
| 4636 | ;; host name matching the previous hop. | 4636 | ;; host name matching the previous hop. |
| 4637 | (let ((previous-host tramp-local-host-regexp)) | 4637 | (let ((previous-host (or tramp-local-host-regexp ""))) |
| 4638 | (setq choices target-alist) | 4638 | (setq choices target-alist) |
| 4639 | (while (setq item (pop choices)) | 4639 | (while (setq item (pop choices)) |
| 4640 | (let ((host (tramp-file-name-host item))) | 4640 | (let ((host (tramp-file-name-host item))) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 52ff021c500..5c785b16d89 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -428,13 +428,19 @@ host runs a registered shell, it shall be added to this list, too." | |||
| 428 | :require 'tramp) | 428 | :require 'tramp) |
| 429 | 429 | ||
| 430 | ;;;###tramp-autoload | 430 | ;;;###tramp-autoload |
| 431 | (defconst tramp-local-host-regexp | 431 | (defcustom tramp-local-host-regexp |
| 432 | (concat | 432 | (concat |
| 433 | "\\`" | 433 | "\\`" |
| 434 | (regexp-opt | 434 | (regexp-opt |
| 435 | (list "localhost" "localhost6" (system-name) "127.0.0.1" "::1") t) | 435 | (list "localhost" "localhost6" (system-name) "127.0.0.1" "::1") t) |
| 436 | "\\'") | 436 | "\\'") |
| 437 | "Host names which are regarded as local host.") | 437 | "Host names which are regarded as local host. |
| 438 | If the local host runs a chrooted environment, set this to nil." | ||
| 439 | :version "27.1" | ||
| 440 | :group 'tramp | ||
| 441 | :type '(choice (const :tag "Chrooted environment" nil) | ||
| 442 | (regexp :tag "Host regexp")) | ||
| 443 | :require 'tramp) | ||
| 438 | 444 | ||
| 439 | (defvar tramp-completion-function-alist nil | 445 | (defvar tramp-completion-function-alist nil |
| 440 | "Alist of methods for remote files. | 446 | "Alist of methods for remote files. |
| @@ -4239,11 +4245,12 @@ be granted." | |||
| 4239 | 4245 | ||
| 4240 | ;;;###tramp-autoload | 4246 | ;;;###tramp-autoload |
| 4241 | (defun tramp-local-host-p (vec) | 4247 | (defun tramp-local-host-p (vec) |
| 4242 | "Return t if this points to the local host, nil otherwise." | 4248 | "Return t if this points to the local host, nil otherwise. |
| 4249 | This handles also chrooted environments, which are not regarded as local." | ||
| 4243 | (let ((host (tramp-file-name-host vec)) | 4250 | (let ((host (tramp-file-name-host vec)) |
| 4244 | (port (tramp-file-name-port vec))) | 4251 | (port (tramp-file-name-port vec))) |
| 4245 | (and | 4252 | (and |
| 4246 | (stringp host) | 4253 | (stringp tramp-local-host-regexp) (stringp host) |
| 4247 | (string-match tramp-local-host-regexp host) | 4254 | (string-match tramp-local-host-regexp host) |
| 4248 | ;; A port is an indication for an ssh tunnel or alike. | 4255 | ;; A port is an indication for an ssh tunnel or alike. |
| 4249 | (null port) | 4256 | (null port) |