[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master cef3174: Improve performance when checking case-sensitivity of Tr
From: |
Michael Albinus |
Subject: |
master cef3174: Improve performance when checking case-sensitivity of Tramp file names |
Date: |
Tue, 9 Nov 2021 13:59:23 -0500 (EST) |
branch: master
commit cef31747b602c423842caa50cbfee9ca804289a3
Author: Jim Porter <jporterbugs@gmail.com>
Commit: Michael Albinus <michael.albinus@gmx.de>
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.
---
lisp/net/tramp-sh.el | 10 +++++-----
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 6292190..b20e5f8 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."
;; Unless NAME is absolute, concat DIR and NAME.
(unless (file-name-absolute-p name)
(setq name (tramp-compat-file-name-concat dir name)))
- ;; If connection is not established yet, run the real handler.
- (if (not (tramp-connectable-p name))
- (tramp-run-real-handler #'expand-file-name (list name nil))
- ;; Dissect NAME.
- (with-parsed-tramp-file-name name nil
+ ;; Dissect NAME.
+ (with-parsed-tramp-file-name name nil
+ ;; If connection is not established yet, run the real handler.
+ (if (not (tramp-connectable-p v))
+ (tramp-run-real-handler #'expand-file-name (list name nil))
(unless (tramp-run-real-handler #'file-name-absolute-p (list localname))
(setq localname (concat "~/" localname)))
;; Tilde expansion if necessary. This needs a shell which
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index b152584..a8972ce 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3484,7 +3484,7 @@ User is always nil."
(tramp-get-method-parameter v 'tramp-case-insensitive)
;; There isn't. So we must check, in case there's a connection already.
- (and (file-remote-p filename nil 'connected)
+ (and (let ((non-essential t)) (tramp-connectable-p v))
(with-tramp-connection-property v "case-insensitive"
(ignore-errors
(with-tramp-progress-reporter v 5 "Checking case-insensitive"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master cef3174: Improve performance when checking case-sensitivity of Tramp file names,
Michael Albinus <=