emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in copy-directory


From: Thierry Volpiatto
Subject: Re: bug in copy-directory
Date: Fri, 04 Feb 2011 18:28:19 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2.93 (gnu/linux)

Michael Albinus <address@hidden> writes:

> Thierry Volpiatto <address@hidden> writes:
>
>> Thierry Volpiatto <address@hidden> writes:
>>
>>> Michael Albinus <address@hidden> writes:
>>>
>>>> Thierry Volpiatto <address@hidden> 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 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]