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: copy-directory Date: Sun, 04 Oct 2009 21:58:51 +0200 Message-ID: <873a5z3p8k.fsf@gmx.de> References: <8763avuyt3.fsf@gmx.de> <83zl87nw88.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1254686373 32139 80.91.229.12 (4 Oct 2009 19:59:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 Oct 2009 19:59:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 04 21:59:26 2009 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.50) id 1MuXEr-0007aF-R4 for ged-emacs-devel@m.gmane.org; Sun, 04 Oct 2009 21:59:26 +0200 Original-Received: from localhost ([127.0.0.1]:44185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MuXEr-0003uw-Rh for ged-emacs-devel@m.gmane.org; Sun, 04 Oct 2009 15:59:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MuXES-0003Us-Ex for emacs-devel@gnu.org; Sun, 04 Oct 2009 15:59:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MuXEP-0003Pl-0S for emacs-devel@gnu.org; Sun, 04 Oct 2009 15:59:00 -0400 Original-Received: from [199.232.76.173] (port=57990 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MuXEO-0003Pc-MS for emacs-devel@gnu.org; Sun, 04 Oct 2009 15:58:56 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]:36459) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MuXEN-00032v-M2 for emacs-devel@gnu.org; Sun, 04 Oct 2009 15:58:56 -0400 Original-Received: (qmail invoked by alias); 04 Oct 2009 19:58:53 -0000 Original-Received: from p57A20AEF.dip0.t-ipconnect.de (EHLO arthur.local) [87.162.10.239] by mail.gmx.net (mp063) with SMTP; 04 Oct 2009 21:58:53 +0200 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX18M9clsQOIM5Xe+insoq53mvH4JOkZgACBJszbu5E hOJIhLz1W7PdnL In-Reply-To: <83zl87nw88.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 04 Oct 2009 15:07:35 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-FuHaFi: 0.62 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:115900 Archived-At: Eli Zaretskii writes: > Please don't rely on the `chown' command being available for the > preserve-uid-gid option. It is only available on Posix platforms. > Instead, please add a primitive to do this from within Emacs. I know that. But I do not know how important it is on W32. > And one more comment about the code: > > (mapc > (lambda (file) > (if (file-directory-p file) > (copy-directory file newname keep-time preserve-uid-gid parents) > (copy-file file newname t keep-time preserve-uid-gid))) > ;; We do not want to delete "." and "..". > (directory-files > directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")) > > Instead of this complicated regexp, isn't it easier to just filter out > "." and ".." by adding a suitable comparison to the function you map > of the files? I find it not easy to convince myself that the regexp > indeed matches every valid file name but those two. I've stolen it from `dired-re-no-dot'. One option would be to add a similar regexp to files.el, given that I have used it also in `delete-directory'? (And I will need it also in Tramp) Best regards, Michael.