]> git.eshelyaron.com Git - emacs.git/commitdiff
Better support for remote file names in dired
authorMichael Albinus <michael.albinus@gmx.de>
Thu, 6 Oct 2022 20:18:21 +0000 (22:18 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Thu, 6 Oct 2022 20:18:21 +0000 (22:18 +0200)
* lisp/dired.el (dired-make-relative): Expand DIR anyway, because
it could also be an abbreviated remote file name.  (Bug#58300)

lisp/dired.el

index 96b580d57634d764351ec6229f33247f8c610bb5..f9a77431393812f8f7c6b6f9883fd9d06ff93dd6 100644 (file)
@@ -2953,11 +2953,7 @@ Optional arg GLOBAL means to replace all matches."
 If DIR is omitted or nil, it defaults to `default-directory'.
 If FILE is not in the directory tree of DIR, return FILE
 unchanged."
-  (or dir (setq dir default-directory))
-  ;; This case comes into play if default-directory is set to
-  ;; use ~.
-  (if (and (> (length dir) 0) (= (aref dir 0) ?~))
-      (setq dir (expand-file-name dir)))
+  (setq dir (expand-file-name (or dir default-directory)))
   (if (string-match (concat "^" (regexp-quote dir)) file)
       (substring file (match-end 0))
     file))