Harvey Chapman <[email protected]> writes:

Hi Harvey,

> This answer was provided and recommended to be passed along to this
> list in the hope that Tramp might make this optimization, too.

Thanks for this report. Yes, I have taken over this change for
`file-in-directory-p', and also for `file-equal-p'. Will be released
with Tramp 2.2.13 (later this year) and Emacs 25.1.

> +                          (equal (file-remote-p file)
> +                                 (file-remote-p topdir))

Here one could also use `string-equal', it is aware of handling a string
being nil.

More important, this works only if file and topdir are absolute file
names. `file-remote-p' returns nil for relative file names, look:

(let ((default-directory "/ssh::"))
  (file-remote-p "foo"))

=> nil

So the test shall be

(string-equal (file-remote-p (expand-file-name file))
              (file-remote-p (expand-file-name topdir)))

That's how I've implemented it in Tramp.

_______________________________________________
Tramp-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/tramp-devel

Reply via email to