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: Fri, 04 Feb 2011 11:17:13 +0100 Message-ID: <878vxw6r4m.fsf@gmx.de> References: <87ipxaidea.fsf@gmail.com> <87k4hp96g0.fsf@stupidchicken.com> <878vy59ejz.fsf@stupidchicken.com> <87lj23ickn.fsf@stupidchicken.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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1296821054 2660 80.91.229.12 (4 Feb 2011 12:04:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 4 Feb 2011 12:04:14 +0000 (UTC) Cc: emacs-devel@gnu.org To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 04 13:04:09 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 1PlKOW-0007xq-1q for ged-emacs-devel@m.gmane.org; Fri, 04 Feb 2011 13:04:08 +0100 Original-Received: from localhost ([127.0.0.1]:57149 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlKOV-00009c-5c for ged-emacs-devel@m.gmane.org; Fri, 04 Feb 2011 07:04:07 -0500 Original-Received: from [140.186.70.92] (port=45169 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlKOO-00008R-Fq for emacs-devel@gnu.org; Fri, 04 Feb 2011 07:04:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PlKON-0004WF-4W for emacs-devel@gnu.org; Fri, 04 Feb 2011 07:04:00 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:35610) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PlKOM-0004VV-Ox for emacs-devel@gnu.org; Fri, 04 Feb 2011 07:03:59 -0500 Original-Received: (qmail invoked by alias); 04 Feb 2011 10:17:16 -0000 Original-Received: from p57BBD4C1.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [87.187.212.193] by mail.gmx.net (mp035) with SMTP; 04 Feb 2011 11:17:16 +0100 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX19076BV+xB0m5i8gQppquj/Lqlwf30iXtAojCC8LR E0khDqABZ9b6AX In-Reply-To: <87d3n8xkeq.fsf@gmail.com> (Thierry Volpiatto's message of "Fri, 04 Feb 2011 09:40:13 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:135569 Archived-At: Thierry Volpiatto writes: > Thierry Volpiatto writes: > >> Michael Albinus writes: >> >>> Thierry Volpiatto writes: >>> >>>> What we could do also is create a function copy-directory-contents, that >>>> reuse the code of precedent version of copy-directory (but not >>>> interactive this time) and call this function in >>>> dired-copy-file-recursive instead of copy-directory. >>>> >>>> In this case we could rewrite copy-directory to avoid duplicate code, >>>> possibly: (no urge in this case as actual copy-directory works fine) >>>> >>>> 1) Writing copy-directory-contents (or whatever name) to allow >>>> creating the structure like actual copy-directory, or not like ancient >>>> version leaving this job to dired-create-files. >>>> >>>> 2) Writing a copy-directory that reuse dired code (i.e dired-create-files). >>>> In this case it would have all interactive messages, ask etc.. >>>> >>>> WDYT? >>> >>> I would prefer option 2). There is no need to have an extra dired >>> implementation, now we have copy-directory. >> >> So i made first steps: >> >> - Create new function copy-directory-contents based on old >> copy-directory code. >> >> - Use it in dired-copy-file-recursive instead of copy-directory. >> >> Seems to work fine. > There was an error though. > > Now the last fix. (sent to Chong) > I think that's correct: > Use a new function copy-directory1 that can be reused by copy-directory, > avoiding duplicate code. I haven't had time yet to review this patch (and the previous one) in detail (pressure @work). On a first view, there is at least the problem that `copy-directory1' calls the file name handler for `copy-directory' - this is bad. > This function use an extra arg `create-struct'. > When this arg is used copy-directory1 works like actual copy-directory. > Otherwise it does like before and doesn't break dired. Why not adding this optional parameter to `copy-directory'? Then you won't need `copy-directory1'. > Thanks Michael and Chong. Best regards, Michael.