From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#58919: 28.2; dired-copy-file-recursive fails to overwrite directory Date: Sun, 18 Dec 2022 20:35:34 +0100 Message-ID: <87fsdcld2x.fsf@gmx.de> References: <87y1sws6eq.fsf@posteo.net> <83wn8gdu4k.fsf@gnu.org> <31dc6bb7-ada3-aeac-c65b-d7de4a326026@cs.ucla.edu> <87k04ebhvn.fsf@gmx.de> <83zgbutdz5.fsf@gnu.org> <83h6xuihgc.fsf@gnu.org> <87y1r69x2e.fsf@gmx.de> <7c209ab7-056b-8300-09b9-87549f6084be@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22169"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: thievol@posteo.net, Eli Zaretskii , 58919-done@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 18 20:36:28 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p6zSU-0005br-8S for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Dec 2022 20:36:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6zS8-0000az-I4; Sun, 18 Dec 2022 14:36:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6zS6-0000al-6M for bug-gnu-emacs@gnu.org; Sun, 18 Dec 2022 14:36:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6zS5-00027B-UJ for bug-gnu-emacs@gnu.org; Sun, 18 Dec 2022 14:36:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p6zS5-0003ji-Lq for bug-gnu-emacs@gnu.org; Sun, 18 Dec 2022 14:36:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Dec 2022 19:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58919 X-GNU-PR-Package: emacs Original-Received: via spool by 58919-done@debbugs.gnu.org id=D58919.167139215514356 (code D ref 58919); Sun, 18 Dec 2022 19:36:01 +0000 Original-Received: (at 58919-done) by debbugs.gnu.org; 18 Dec 2022 19:35:55 +0000 Original-Received: from localhost ([127.0.0.1]:35552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6zRz-0003jU-07 for submit@debbugs.gnu.org; Sun, 18 Dec 2022 14:35:55 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:45791) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6zRx-0003jO-2I for 58919-done@debbugs.gnu.org; Sun, 18 Dec 2022 14:35:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1671392135; bh=E+ErzbHQ520NjYT4IHQWzc1QQiW+ZaN7SR4FB0lsVk4=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=qQfnk5lyaCKgB9pnYQF4+GDnaRaGtUN7aOw2BnPDh0arhA/kizL6LvKo4SnIvLiWz j4+0DNwcz5r/OgpNzp48Y6wv2BDjsHvi2Sl52wW4o1ArHo/qJ+oHn3zOb5n4sOjq6/ z0gzjKgAQ+z0GmjMWwHdPqaTI3bxDmnLOdVDU8XcYRY3cPVQ+mtdwuxvUdosWFYVfg hMXuzfNOMsF7l0E4BWPQx476PK2v14sI8krKSm1Y2c8UjBHOqEWIJ7+F/DboZCMwle PugFxTNhnOS0oS39IBKCeC/0c5hr/GtM2MbdLZTGM6YfPkKtbZ3Seohf4uoqWv+KOK RPY1tmJrf55iQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.37.45]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MacOW-1oVAWT2kiw-00c9q1; Sun, 18 Dec 2022 20:35:35 +0100 In-Reply-To: <7c209ab7-056b-8300-09b9-87549f6084be@cs.ucla.edu> (Paul Eggert's message of "Sat, 17 Dec 2022 14:40:09 -0800") X-Provags-ID: V03:K1:DPUFfz5+rvhcSN3aXszFtPt40Tov7+AcJe0+cuw/Dcz75DbCfzx u+xaVXsVR+Mfmx9qkkybnZC3VyFKIxjDfCO+Cerh5TYo07+s5d17KUnpZK3cRepw6oMzUzR xQYMJiLADoL4PyPIbUxjSsBOiDzDKtvCX9bqMxUq05jBAL6TriQV3Cc3kGz8rdXJ1zTEYLN hGAOUoeeXQIvKuzBwwwlQ== UI-OutboundReport: notjunk:1;M01:P0:qg4IbYY4pzc=;/tMSKK0oQFhoD+KE6H3oTfAHhvn l9clnGs8p1VLFWJrQE28ki0bEhCE8XytE9V7XZsTyhWALk6CBMoK9cP+cvDaCbEcypuaTik5u el/DQqnTj1kPM9ZTtGpteR9rx0QFBPRdlon3IppT4vWkxyFmsAI4AXZNsOvdOoXYYCuhd6Tyz BBEoZl31l2pk0mm6udEZgC+DxPtCfdXz0bMrCz7Ll/+1JdFQSCshsPo2eH04MSE2CYXLin33K PWfi8qz6cMtknPV36qoWi51+Sp4P3z1ktffFRCSwPtam8c1RmJRmAiXFsX4UWQ3Kajhqouwoi UpVC/S5Lxl+Wm2AwtI0ScIsxNYmnp5nHu3EEIqSb7OWniiqjdPlKcT/N6+F2TPFp+yeN8cFiF 3vnTcfS0+WwlulAL2NG+CdVnSwJs5iAzZUNEqBWxS/UlBGjgRrHcaX+7O7jhNTdIBNIMTA0GL T7DZn22GY7KPIyrIqTEyKiz+13l/2SMoslOMCNO8ajjDZrpijlXh0M6mbeWoSn68UJnvkNXzx +cxook0YFuZf5aJI5ssgwNev9RhXphbpOkFRD/u2sr+vQubKSl3nA8BGQdZo66pqK0jA1kqE6 3NkL/rzA03x9u/xkkJPdKheqTu4GgDtatAWYTLTFwj26NYqzbBRB+PrBDQSaB96POBugDLONx OS7pxKfZUu/9ZJc/ImMQwf4J2L6J5/jdfYhdU3168tBZBHOThS7CbGnpelwaMEdOBTuCWFHJ0 dDZ9myi+ZV2xykhjYLO/qV1/kmnB/5YNmjsVWFilvUuXeBJHL9PZd/css/8rKbut47v0lioA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251375 Archived-At: Paul Eggert writes: Hi Paul, > On 12/17/22 01:52, Michael Albinus wrote: >> Since file name handlers still raise an error in case DIR exists and >> PARENTS is nil, we might see surprises in code assuming the new >> behavior. I guess I'll add a change in tramp-*-handle-make-directory >> like >> >> --8<---------------cut here---------------start------------->8--- >> (if (and (null parents) (file-exists-p dir)) >> (if (>= emacs-major-version 29) >> t >> (tramp-error v 'file-already-exists dir))) >> --8<---------------cut here---------------end--------------->8--- > > That doesn't look right, as there is no change as to whether > make-directory signals an error. Nor is there any change in behavior > when PARENTS is nil. The only change in behavior is when PARENTS is > non-nil and DIRECTORY already exists as a directory: in this case, > Emacs 29 returns non-nil whereas earlier Emacs returns (undocumented) > nil. Hmm, you're right. I re-read your make-directory code, it looks like PARENTS isn't propagated any longer to the file name handlers. So this must be handled documented there, at least. > So I think all that it would be nice to do is make sure the handlers > ordinarily return nil, except that they return non-nil in the > abovementioned special case. If a handler currently signals an error, > it should continue to do so in the same way as it did before. Strictly > speaking, modifying the handlers in this way won't affect whether they > are compatible with Emacs 28- (since their return value is > undocumented there) nor will it affect whether they work in Emacs 29 > (since Emacs 29 ignores their return value). But it might affect > whether the handlers will work with Emacs 30, which might start > assuming the Emacs 29 API for make-directory handlers. Yep. Using the return value of the handlers shall be re-enabled in Emacs 30. > Come to think of it, if an existing make-directory handler returns > non-nil now (which it is allowed to in Emacs 28 as the return value is > undocumented), then the proposed changes would sometimes have caused > make-directory to return that non-nil value to its caller, even when > the Emacs 29 doc says make-directory should return nil. As far as I > know no such make-directory handler does so now, but to be safe I > installed the attached additional patch to make sure Emacss 29 > make-directory returns nil in this situation. As the combined set of > patches should fix the original bug report I'm marking it as done. > > In Emacs 30 we could remove this additional patch once we've fixed all > the handlers, along with omitting some of the other code that supports > calling Emacs 28-style handlers in Emacs 30 environments. Or we could > leave it in; there's no rush, I imagine. Yes, I will adapt the Tramp and ange-ftp handlers accordingly. Since the return value is either undocumented, or (in Emacs 29) suppressed, there's no harm. For the time being, I have applied a small patch fixing an issue from your last tramp-smb.el change. Best regards, Michael.