From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: bug in copy-directory Date: Fri, 04 Feb 2011 18:28:19 +0100 Message-ID: <87pqr790b0.fsf@gmail.com> 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> <878vxw6r4m.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1296841842 23252 80.91.229.12 (4 Feb 2011 17:50:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 4 Feb 2011 17:50:42 +0000 (UTC) Cc: emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 04 18:50:37 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 1PlPnl-0003K4-TV for ged-emacs-devel@m.gmane.org; Fri, 04 Feb 2011 18:50:34 +0100 Original-Received: from localhost ([127.0.0.1]:37542 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlPTV-0006bw-T6 for ged-emacs-devel@m.gmane.org; Fri, 04 Feb 2011 12:29:37 -0500 Original-Received: from [140.186.70.92] (port=35652 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlPSh-0006XS-FV for emacs-devel@gnu.org; Fri, 04 Feb 2011 12:29:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PlPSM-0006DT-NB for emacs-devel@gnu.org; Fri, 04 Feb 2011 12:28:28 -0500 Original-Received: from mail-ww0-f41.google.com ([74.125.82.41]:35745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PlPSM-0006DH-II for emacs-devel@gnu.org; Fri, 04 Feb 2011 12:28:26 -0500 Original-Received: by wwi18 with SMTP id 18so566761wwi.0 for ; Fri, 04 Feb 2011 09:28:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=JbuS5iW4yWOso+WHgQIRvbbqtP406ATxw8zF5sYHhBk=; b=MTnR9l83uy3NwlubAO1SbTc9Wl1WtJ8Ol1Tk3kXrI5aAWS8/VNbTDh5W6fZIH3NyMk oJiq5rtTasTkrEtzm3ZC4c6F45D8zrwNsjg2uGgzN1b15NZFA+F9S4sgylIB8HTl85v0 Ju4iiAInAPzbShYXS+YfScuQijGCVBV/3w+pY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=byJBlz3MwMu2MEGbJ8FtxCV7ctQohA7EyM581VOq2lGM2OZgm7I0llJ/O/N7r2yvST Px5F/mUwl+t2fS0w+rA3YEH9dc9kUOYaxAdBfztVBDtItL7/2q/hecxJKw8R0KxABaUs pYTGxM216f7yjH3VQXpog1wD6AiiMV/takRbc= Original-Received: by 10.216.29.71 with SMTP id h49mr11489129wea.46.1296840504284; Fri, 04 Feb 2011 09:28:24 -0800 (PST) Original-Received: from thierry-MM061 (95.78.88-79.rev.gaoland.net [79.88.78.95]) by mx.google.com with ESMTPS id a50sm503296wer.42.2011.02.04.09.28.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 04 Feb 2011 09:28:22 -0800 (PST) In-Reply-To: <878vxw6r4m.fsf@gmx.de> (Michael Albinus's message of "Fri, 04 Feb 2011 11:17:13 +0100") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2.93 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.41 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:135578 Archived-At: Michael Albinus writes: > 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). Forget the previous patch. > On a first view, there is at least the problem > that `copy-directory1' calls the file name handler for `copy-directory' > - this is bad. So if using just one function like you suggest after, it should be ok to leave `copy-directory'? NOTE: To have the same behavior as copy-directory in non--interactive call, you will have to use extra arg: (copy-directory A B nil nil 'create-struct) instead of (copy-directory A B) Don't know if it will have effect in tramp. Maybe in ssh method? >> 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'. Yes, why not. In this case need only to put the interactive code in copy-directory1 without forgeting to put the optional argument create-struct at end. (It have to be used in all interactive calls of copy-directory). >> Thanks Michael and Chong. > > Best regards, Michael. -- A+ Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997