Subject: bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy

From: Stefan Monnier <[email-masked]>
Date: Sat, 25 Feb 2012 04:56:18 -0500

>> > If FILE1 and FILE2 have different 'files-equal-p handlers, which one
>> > of them, if any, should be invoked here?
>> The one for FILE1.
> Can you explain why?

It's just a convention.  We already do that in the few other file
primitives that bump into the same problem.

> My question wasn't rhetorical, it was due to a real confusion about
> what should be done in this situation and why.

It's the responsibility of FILE1's handler to check FILE2's handler.

>> > Also, if each file has a different handler, doesn't that in
>> > itself already mean the files are not equal?

No: /foo should be equal to file:///foo (if you use url-handler-mode)
but they don't use the same handler.

>> We shouldn't add too much to file name handler optimization here.
>> The handler will know what to do.
> "Will know" how?  Is it documented anywhere how to write a handler so
> it handles such situations?  If so, please point me to that
> documentation, and perhaps I will see the light there.

There is no right answer, in general, so no it's not documented.  But at
least the file handler's writer, thanks to his knowledge of the special
semantics of his handler, should be able to write something useful.

        Stefan