From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: bug in copy-directory Date: Tue, 08 Feb 2011 17:39:02 +0100 Message-ID: <87zkq6a3bt.fsf@gmx.de> References: <87ipxaidea.fsf@gmail.com> <87sjway8i3.fsf@gmx.de> <87wrll2ebe.fsf@stupidchicken.com> <87hbcot7gq.fsf@gmx.de> <87ei7qrdp0.fsf@gmail.com> <87ipx2dayh.fsf@gmx.de> <87y65yyxfu.fsf@gmail.com> <87d3n8xkeq.fsf@gmail.com> <878vxw6r4m.fsf@gmx.de> <87pqr790b0.fsf@gmail.com> <87oc6r7gjc.fsf@gmx.de> <87ipwz8t92.fsf@gmail.com> <878vxt69k7.fsf@stupidchicken.com> <874o8hbc9q.fsf@gmx.de> <87tygh8ez6.fsf@stupidchicken.com> <87zkq7okvk.fsf@gmx.de> <87vd0vwy0k.fsf@gmail.com> <87pqr2c2a7.fsf@gmx.de> <87sjvysshj.fsf@gmail.com> <87ipwubw8s.fsf@gmx.de> <87oc6msgzt.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1297183164 26939 80.91.229.12 (8 Feb 2011 16:39:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 8 Feb 2011 16:39:24 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 08 17:39:19 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pmqb0-0007g3-OX for ged-emacs-devel@m.gmane.org; Tue, 08 Feb 2011 17:39:18 +0100 Original-Received: from localhost ([127.0.0.1]:36752 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pmqb0-0003Ko-40 for ged-emacs-devel@m.gmane.org; Tue, 08 Feb 2011 11:39:18 -0500 Original-Received: from [140.186.70.92] (port=37232 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pmqas-0003Iy-5e for emacs-devel@gnu.org; Tue, 08 Feb 2011 11:39:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pmqaq-0001lo-SH for emacs-devel@gnu.org; Tue, 08 Feb 2011 11:39:10 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:48378) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Pmqaq-0001lV-Ic for emacs-devel@gnu.org; Tue, 08 Feb 2011 11:39:08 -0500 Original-Received: (qmail invoked by alias); 08 Feb 2011 16:39:06 -0000 Original-Received: from p57BB90E5.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [87.187.144.229] by mail.gmx.net (mp057) with SMTP; 08 Feb 2011 17:39:06 +0100 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX18U3bh8EV0UoVZrJAg0xfp6bByYI4lwe3JqERRJ7Q XJp/Ma0PZe9ZrV In-Reply-To: <87oc6msgzt.fsf@gmail.com> (Thierry Volpiatto's message of "Tue, 08 Feb 2011 16:06:30 +0100") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.165.64.23 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:135761 Archived-At: Thierry Volpiatto writes: >> Technically, there might be no problem. But it is unclean to call a file >> name handler in a function which is not intended for. And also the >> parameter lists differ between copy-directory and copy-directory1. > Not now, parameters are the same, last arg has been removed in both > functions. > now we have: > > (defun copy-directory (directory newname &optional keep-time parents) > ...) > > > (defun copy-directory-1 (directory newname &optional keep-time parents) > ...) > >> It's just a feeling that this kind of hacks could cause trouble in the >> future. However, if Chong/Stefan do not oppose, I'll shut up and make >> the changes in Tramp and ange-ftp.el. > So maybe you will have no changes to do. Using your latest patches, I've tried M-: (copy-directory "/ssh::/tmp/test" "/ssh::~/") This results in a wrong target directory structure. This is, because Tramp has no own implementation of copy-directory for the ssh method, it falls back to the default implementation. So we have the call tree: copy-directory -> copy-directory-1 -> tramp-handle-copy-directory -> copy-directory You see, there are serious problems when a file name handler is called from a function which shouldn't. M-: (copy-directory-1 "/ssh::/tmp/test" "/ssh::~/") works fine. Given this behaviour, the file name handler should be provided for copy-directory-1, which is just a helper function ... Maybe it has been discussed at the beginning already, but I don't catch what is wrong with using the implementation of copy-directory-1 for copy-directory. Best regards, Michael.