GNU bug report logs - #10489
24.0.92; dired-do-copy may create infinite directory hierarchy

Previous Next

Package: emacs;

Reported by: michael_heerdegen <at> web.de

Date: Thu, 12 Jan 2012 19:36:01 UTC

Severity: important

Tags: patch

Merged with 11130

Found in version 24.0.92

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 10489 <at> debbugs.gnu.org, thierry.volpiatto <at> gmail.com
Subject: bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy
Date: Sat, 25 Feb 2012 09:05:02 +0200
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Cc: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>,  10489 <at> debbugs.gnu.org
> Date: Fri, 24 Feb 2012 21:33:26 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
> >> Cc: Eli Zaretskii <eliz <at> gnu.org>,  10489 <at> debbugs.gnu.org
> >> Date: Fri, 24 Feb 2012 17:02:16 +0100
> >> 
> >> (defun files-equal-p (file1 file2)
> >>   "Return non-nil if FILE1 and FILE2 name the same file."
> >>   (let ((handler (or (find-file-name-handler file1 'files-equal-p)
> >>                      (find-file-name-handler file2 'files-equal-p))))
> >>     (if handler
> >>         (funcall handler 'files-equal-p file1 file2)
> >
> > 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?  My question wasn't rhetorical, it was due to a
real confusion about what should be done in this situation and why.

> > IOW, shouldn't we invoke a file handler only if it can handle _both_
> > files?  Also, if each file has a different handler, doesn't that in
> > itself already mean the files are not equal?
> 
> 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.

> Likely, there won't be different handlers. It's always
> `tramp-file-name-handler', which calls the respective sub-handlers.

??? Are we to assume that a file-handler is always the Tramp handler?
What about others, like jka-compr?




This bug report was last modified 13 years and 58 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.