emacs-diffs
[Top][All Lists]
Advanced

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

master 80d0ff46127: Minor Tramp optimization


From: Michael Albinus
Subject: master 80d0ff46127: Minor Tramp optimization
Date: Sat, 18 Nov 2023 08:39:28 -0500 (EST)

branch: master
commit 80d0ff46127d797c081b54be24e167531ddcec07
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Minor Tramp optimization
    
    * lisp/net/tramp.el (tramp-skeleton-file-truename)
    (tramp-skeleton-write-region, tramp-handle-file-truename):
    * lisp/net/tramp-integration.el (tramp-eshell-directory-change)
    (tramp-recentf-exclude-predicate):
    * lisp/net/tramp-smb.el (tramp-smb-handle-copy-file):
    * lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file):
    Use `tramp-tramp-file-p' instead of `file-remote-p'.
---
 lisp/net/tramp-integration.el | 4 ++--
 lisp/net/tramp-smb.el         | 2 +-
 lisp/net/tramp-sudoedit.el    | 6 +++---
 lisp/net/tramp.el             | 6 +++---
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el
index c73c86a9110..f67d8a0ec2f 100644
--- a/lisp/net/tramp-integration.el
+++ b/lisp/net/tramp-integration.el
@@ -136,7 +136,7 @@ been set up by `rfn-eshadow-setup-minibuffer'."
   ;; Remove last element of `(exec-path)', which is `exec-directory'.
   ;; Use `path-separator' as it does eshell.
   (setq eshell-path-env
-        (if (file-remote-p default-directory)
+        (if (tramp-tramp-file-p default-directory)
             (string-join (butlast (exec-path)) path-separator)
           (getenv "PATH"))))
 
@@ -158,7 +158,7 @@ been set up by `rfn-eshadow-setup-minibuffer'."
 (defun tramp-recentf-exclude-predicate (name)
   "Predicate to exclude a remote file name from recentf.
 NAME must be equal to `tramp-current-connection'."
-  (when (file-remote-p name)
+  (when (tramp-tramp-file-p name)
     (tramp-file-name-equal-p
      (tramp-dissect-file-name name) (car tramp-current-connection))))
 
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index e0622a26eeb..87fbb93e810 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -618,7 +618,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
       ;; with `jka-compr-handler', so we cannot trust its result as
       ;; indication for a remote file name.
       (if-let ((tmpfile
-               (and (file-remote-p filename) (file-local-copy filename))))
+               (and (tramp-tramp-file-p filename) (file-local-copy filename))))
          ;; Remote filename.
          (condition-case err
              (rename-file tmpfile newname ok-if-already-exists)
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el
index 87685c06c1f..742b8128199 100644
--- a/lisp/net/tramp-sudoedit.el
+++ b/lisp/net/tramp-sudoedit.el
@@ -274,8 +274,8 @@ absolute file names."
                     (not (directory-name-p newname)))
            (tramp-error v 'file-error "File is a directory %s" newname))
 
-         (if (or (and (file-remote-p filename) (not t1))
-                 (and (file-remote-p newname)  (not t2)))
+         (if (or (and (tramp-tramp-file-p filename) (not t1))
+                 (and (tramp-tramp-file-p newname)  (not t2)))
              ;; We cannot copy or rename directly.
              (let ((tmpfile (tramp-compat-make-temp-file filename)))
                (if (eq op 'copy)
@@ -296,7 +296,7 @@ absolute file names."
 
          ;; When `newname' is local, we must change the ownership to
          ;; the local user.
-         (unless (file-remote-p newname)
+         (unless (tramp-tramp-file-p newname)
            (tramp-set-file-uid-gid
             (concat (file-remote-p filename) newname)
             (tramp-get-local-uid 'integer)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 54f92cae98d..a21e6823424 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3447,7 +3447,7 @@ BODY is the backend specific code."
               "Apparent cycle of symbolic links for %s" ,filename))
            ;; If the resulting localname looks remote, we must quote
            ;; it for security reasons.
-           (when (file-remote-p result)
+           (when (tramp-tramp-file-p result)
              (setq result (file-name-quote result 'top)))
            result)))))))
 
@@ -3587,7 +3587,7 @@ BODY is the backend specific code."
           ;; Lock file.
           (when (and (not (auto-save-file-name-p
                            (file-name-nondirectory filename)))
-                     (file-remote-p lockname)
+                     (tramp-tramp-file-p lockname)
                      (not file-locked))
             (setq file-locked t)
             ;; `lock-file' exists since Emacs 28.1.
@@ -4117,7 +4117,7 @@ Let-bind it when necessary.")
                  (< numchase numchase-limit))
        (setq numchase (1+ numchase)
              result
-             (if (file-remote-p symlink-target)
+             (if (tramp-tramp-file-p symlink-target)
                  (file-name-quote symlink-target 'top)
                (tramp-drop-volume-letter
                 (expand-file-name



reply via email to

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