[Top][All Lists]

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

Re: bug in copy-directory

From: Michael Albinus
Subject: Re: bug in copy-directory
Date: Fri, 04 Feb 2011 11:17:13 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

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). 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.

reply via email to

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