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

From: Michael Albinus <[email-masked]>
Date: Fri, 13 Jan 2012 14:32:32 +0100

Juanma Barranquero <[email-masked]> writes:

>>  (compare-strings (file-truename (expand-file-name name1 dir)) 0 nil
>>                   (file-truename (expand-file-name name2 dir)) 0 nil
>>                   read-file-name-completion-ignore-case))
>
> I think we should push for it to be added to Emacs, if only for the
> thrill of having a ChangeLog entry
>
> 2012-01-13  Michael Albinus <[email-masked]>
> 	    Juanma Barranquero  <[email-masked]>
> 	    Eli Zaretskii <[email-masked]>
>
> 	* files.el (file-name-compare): New function.
>
> i.e., three authors for a three-line function (plus header and comments) ;-)

Perfect reasoning, I'm for it :-)

Thinking about, `file-truename' would need some massage for the remote
case. Currently, it just expands symlinks. But it could also do some
normalization for the user and host name. For example:

(file-truename "/ssh:127.0.0.1:/path/to/symlink")
 => "/ssh:albinus@localhost:/extend/path/to/file"

But that's for Emacs 24.2, of course.

> Juanma

Best regards, Michael.