diff options
| author | Jim Porter | 2021-11-09 19:59:14 +0100 |
|---|---|---|
| committer | Michael Albinus | 2021-11-09 19:59:14 +0100 |
| commit | cef31747b602c423842caa50cbfee9ca804289a3 (patch) | |
| tree | 6e57c298a0f62f1d6abbb97c9d53a1732632aaab | |
| parent | 3b5069e225983c9f894017f41f0a96a72020206f (diff) | |
| download | emacs-cef31747b602c423842caa50cbfee9ca804289a3.tar.gz emacs-cef31747b602c423842caa50cbfee9ca804289a3.zip | |
Improve performance when checking case-sensitivity of Tramp file names
* lisp/net/tramp-sh.el (tramp-sh-handle-expand-file-name):
Dissect file name before testing for connectability to reduce
duplicated work.
* lisp/net/tramp.el (tramp-handle-file-name-case-insensitive-p):
Use `tramp-connectable-p' to test for connection.
| -rw-r--r-- | lisp/net/tramp-sh.el | 10 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 62921909406..b20e5f80732 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -2705,11 +2705,11 @@ the result will be a local, non-Tramp, file name." | |||
| 2705 | ;; Unless NAME is absolute, concat DIR and NAME. | 2705 | ;; Unless NAME is absolute, concat DIR and NAME. |
| 2706 | (unless (file-name-absolute-p name) | 2706 | (unless (file-name-absolute-p name) |
| 2707 | (setq name (tramp-compat-file-name-concat dir name))) | 2707 | (setq name (tramp-compat-file-name-concat dir name))) |
| 2708 | ;; If connection is not established yet, run the real handler. | 2708 | ;; Dissect NAME. |
| 2709 | (if (not (tramp-connectable-p name)) | 2709 | (with-parsed-tramp-file-name name nil |
| 2710 | (tramp-run-real-handler #'expand-file-name (list name nil)) | 2710 | ;; If connection is not established yet, run the real handler. |
| 2711 | ;; Dissect NAME. | 2711 | (if (not (tramp-connectable-p v)) |
| 2712 | (with-parsed-tramp-file-name name nil | 2712 | (tramp-run-real-handler #'expand-file-name (list name nil)) |
| 2713 | (unless (tramp-run-real-handler #'file-name-absolute-p (list localname)) | 2713 | (unless (tramp-run-real-handler #'file-name-absolute-p (list localname)) |
| 2714 | (setq localname (concat "~/" localname))) | 2714 | (setq localname (concat "~/" localname))) |
| 2715 | ;; Tilde expansion if necessary. This needs a shell which | 2715 | ;; Tilde expansion if necessary. This needs a shell which |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index b152584c1f8..a8972ce69e8 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -3484,7 +3484,7 @@ User is always nil." | |||
| 3484 | (tramp-get-method-parameter v 'tramp-case-insensitive) | 3484 | (tramp-get-method-parameter v 'tramp-case-insensitive) |
| 3485 | 3485 | ||
| 3486 | ;; There isn't. So we must check, in case there's a connection already. | 3486 | ;; There isn't. So we must check, in case there's a connection already. |
| 3487 | (and (file-remote-p filename nil 'connected) | 3487 | (and (let ((non-essential t)) (tramp-connectable-p v)) |
| 3488 | (with-tramp-connection-property v "case-insensitive" | 3488 | (with-tramp-connection-property v "case-insensitive" |
| 3489 | (ignore-errors | 3489 | (ignore-errors |
| 3490 | (with-tramp-progress-reporter v 5 "Checking case-insensitive" | 3490 | (with-tramp-progress-reporter v 5 "Checking case-insensitive" |