From unknown Mon Jun 23 04:10:37 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#28834 <28834@debbugs.gnu.org> To: bug#28834 <28834@debbugs.gnu.org> Subject: Status: 25.1; dired-do-copy: allow to copy into a nonexistent directory Reply-To: bug#28834 <28834@debbugs.gnu.org> Date: Mon, 23 Jun 2025 11:10:37 +0000 retitle 28834 25.1; dired-do-copy: allow to copy into a nonexistent directo= ry reassign 28834 emacs submitter 28834 "alexei28" severity 28834 wishlist tag 28834 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 14 10:52:37 2017 Received: (at submit) by debbugs.gnu.org; 14 Oct 2017 14:52:37 +0000 Received: from localhost ([127.0.0.1]:40344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3Nno-0007eT-R8 for submit@debbugs.gnu.org; Sat, 14 Oct 2017 10:52:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46043) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3K5x-0008Bc-4Q for submit@debbugs.gnu.org; Sat, 14 Oct 2017 06:55:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3K5q-0003YW-9r for submit@debbugs.gnu.org; Sat, 14 Oct 2017 06:54:59 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46727) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3K5q-0003YR-5y for submit@debbugs.gnu.org; Sat, 14 Oct 2017 06:54:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3K5o-0006qR-2K for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 06:54:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3K5j-0003XT-SE for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 06:54:55 -0400 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:53273) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e3K5j-0003X6-GC for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2017 06:54:51 -0400 Received: by mail-wm0-x231.google.com with SMTP id q132so25815195wmd.2 for ; Sat, 14 Oct 2017 03:54:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version:thread-index :content-language; bh=v7SVS/atd4Dyn5kYxCi9Eugsr1mC9dt7fIHMtYSIfmY=; b=QVqeoD0gjIIHoGu/tnGSRutYedY8Y8/aPGgbtL6AbSmtm87tVGqj6ltMbwybw1SHWe rZRFm7g89jjIY/TBqhTOiH20bN/wpCMto4aTXIVQEq0eV873qTp6m8Fm3WRxjHVqoYmu TJsvEorhrB6oBYXBg097ZCweeTYfiB+l6Ad5yN3S6AHzhu6GS7n2bj89mhlfp0QBXM9f qpwomP9f8Yk0CyZQZ42kUzat4hUxmX4Q6zcBKSuein7HaYRnOCekOlJmS+v3Ktz4Ec7A LbhOAfEMX/mopexnIq4oNsy7Ase0Toly6Bjsmp1HYSN+tTVVmKDy1DhxcPQL1qpuLIcR LY+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :thread-index:content-language; bh=v7SVS/atd4Dyn5kYxCi9Eugsr1mC9dt7fIHMtYSIfmY=; b=iuFC1+nvFuc/x9gVCVdFtN/wQvhImoJktSRFAQ94oQCZuDUgoJ4YPqIkshI5lSaXa7 kERiHdWZpWgnB93tPEesQpFxllQE8iQebGeApraNp2AECBnrprOJzHEkxf+AeRi7KvRD yW0QyuauNZUMaeck6F+eBEsuGa58GcgTWbiEaLe3nxKYhjKtz0iN3ZJ6NGxW/BanqbDJ 63bDt8YfGVmEPm5FFCdan/kMjqilrx648/lb7IO65KRcX/sNDiS4VOwEGRn5QwAr1XP4 db1OiihCmdFeFbqboFlqlm0Slr30n1gdAhBwBwcNb5JyRjokNRmMaKJtIH55T8za3yKW rfvA== X-Gm-Message-State: AMCzsaUfBj9qvxD8VygwGgXyhbWt62nd+JYQLCXgbiakrzCeb3ZetmdH X1LHhHPYCwHC3ALDuBS6sA2ElQ== X-Google-Smtp-Source: ABhQp+Qr7Y3KQ/GlMLaLXM7azt9L0tD2cTSSy209TMSGAEXbLy7eZ/+WZRRWinVelZNM/8ksy09GeQ== X-Received: by 10.28.63.134 with SMTP id m128mr3730466wma.137.1507978488712; Sat, 14 Oct 2017 03:54:48 -0700 (PDT) Received: from Zhelev ([188.138.204.216]) by smtp.gmail.com with ESMTPSA id v2sm2942906wmf.40.2017.10.14.03.54.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Oct 2017 03:54:47 -0700 (PDT) From: "alexei28" To: Subject: 25.1; Dired+ not copy file to nonexistent directory. Date: Sat, 14 Oct 2017 13:54:45 +0300 Message-ID: <006201d344da$d9316a50$8b943ef0$@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0063_01D344F3.FE7FB3C0" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdNE2rsFL+oYEU0SRN2rkzRDYbufmQ== Content-Language: en-us X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 14 Oct 2017 10:52:35 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) This is a multipart message in MIME format. ------=_NextPart_000_0063_01D344F3.FE7FB3C0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi! Windows 10, Emacs 25.1, Dired+ I want to copy file from "d:/TEMP/test/test.txt" to nonexistent directory "d:/TEMP/test/new/" in tby package Dired+ My steps in Dired+ buffer: 1. Run command "split-window-vertically" 2. In top and bottom buffers has directory "d:/TEMP/test/" 3. Press "Shift c" (copy file) 4. In minibuffer show message: "Copy text.txt to : d:/TEMP/test/" 5. I replace target path by: "d:/TEMP/test/new/test.txt" and press return 6. I get the next error message: Copy 'd:/TEMP/test/test.txt' to 'd:/TEMP/test/new/test.txt' failed: (file-error Copying file Operation not permitted d:/TEMP/test/test.txt d:/TEMP/test/new/test.txt) It would be good if Emacs can autocreate not exist directory when copy/move files. Thank you. Alex ------=_NextPart_000_0063_01D344F3.FE7FB3C0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi!

 

Windows 10, = Emacs 25.1, Dired+

 

I want to = copy file from "d:/TEMP/test/test.txt" to nonexistent = directory "d:/TEMP/test/new/" in tby package = Dired+

 

My steps in Dired+ buffer:

1. Run command = "split-window-vertically"

2. In top and bottom buffers has directory = "d:/TEMP/test/"

3. Press = "Shift c" (copy file)

4. In = minibuffer show message: "Copy text.txt to : = d:/TEMP/test/"

5. I replace = target path by: "d:/TEMP/test/new/test.txt" and press = return

6. I get the next error = message:

 

Copy ‘d:/TEMP/test/test.txt’ to = ‘d:/TEMP/test/new/test.txt’ failed:

(file-error Copying file Operation not permitted = d:/TEMP/test/test.txt d:/TEMP/test/new/test.txt)

 

It would be = good if Emacs can autocreate not exist directory when copy/move = files.

Thank you.

 

Alex

------=_NextPart_000_0063_01D344F3.FE7FB3C0-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 14 11:50:58 2017 Received: (at 28834) by debbugs.gnu.org; 14 Oct 2017 15:50:58 +0000 Received: from localhost ([127.0.0.1]:40407 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3OiI-0000o1-7C for submit@debbugs.gnu.org; Sat, 14 Oct 2017 11:50:58 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:41720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3OiG-0000nj-1c for 28834@debbugs.gnu.org; Sat, 14 Oct 2017 11:50:56 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v9EFomYb003800 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 14 Oct 2017 15:50:50 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v9EFomlh028059 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 14 Oct 2017 15:50:48 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v9EFomA1023027; Sat, 14 Oct 2017 15:50:48 GMT MIME-Version: 1.0 Message-ID: <298c51ce-d1b5-4bab-9a0b-2b85e73fece3@default> Date: Sat, 14 Oct 2017 08:50:46 -0700 (PDT) From: Drew Adams To: alexei28 , 28834@debbugs.gnu.org Subject: RE: bug#28834: 25.1; Dired+ not copy file to nonexistent directory. References: <006201d344da$d9316a50$8b943ef0$@gmail.com> In-Reply-To: <006201d344da$d9316a50$8b943ef0$@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4600.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: 28834 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) To be clear, this is really about vanilla Dired, not Dired+. The title should perhaps be changed. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 14 22:37:03 2017 Received: (at control) by debbugs.gnu.org; 15 Oct 2017 02:37:03 +0000 Received: from localhost ([127.0.0.1]:40791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3YnX-0007fX-Eq for submit@debbugs.gnu.org; Sat, 14 Oct 2017 22:37:03 -0400 Received: from mail-pg0-f51.google.com ([74.125.83.51]:57111) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3YnU-0007eu-LR for control@debbugs.gnu.org; Sat, 14 Oct 2017 22:37:01 -0400 Received: by mail-pg0-f51.google.com with SMTP id m18so4131764pgd.13 for ; Sat, 14 Oct 2017 19:37:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:to:from:subject; bh=hfX5Dd1Uz6HLMGj5vs83V9FrgnFTvckW7PSNk9bqNMQ=; b=BWmq5UShjlpvPa51ytmIxrqNkMrdJ+HcZxOK0hXgZ1ZWfafwN4dNOorTja0SmyIuRF 9yAIlUhZ0wPD4e58vQguu/IJvkxs233h0C79uHy7FOemqVBGYNMxeTMyg9zFzX5XGj6A 0JkOGB27+m4qKkOVGagbL1W1SfEn9+miyUEtfoS4AsFSWgKgXkbHRhlPit6ALKUt0Tn7 CfRa88f/iZ+iegQyWSq8BOlu39XER+T6pJ6InfCegVWFHhHTOJ6OMTPHiVEN0tM5iM78 qcY5FdSJ/2W5TrcIapo2m+ChEpoHRmigJDWY6a8wtDKdn+1st4xamDSkq+/3LiQ12Vm8 Jsjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:to:from:subject; bh=hfX5Dd1Uz6HLMGj5vs83V9FrgnFTvckW7PSNk9bqNMQ=; b=QbCXyBmU41iP4ZwArWUD1XKz9bPnEd2ukWID+DuWCFGDBWgfZ4TSIzcupB9weZqqcx ZnxyJqsnf9am481fIrPLLFloiB+2pC9rar2sx6DAGmuoDdgfhntNzMOA3J2WyQkvHV6J +NuUtnWic6MD+1pocCpocOrDaKAGVTSJV7+T5BwQR6xbIqKYp+dTZ0fokSGdawm/2qbb jc5H/6pfYMBv2bR/F0LWH+bIGmFhSa2ozktU7EOJ/CtjDWHxTlLN82gJp73GpEeMc8Nv Nkbu6du8yyS7LVO7rBWNjdV/7Souq9Morw6z22VL9TTcPCO7+Op7LGxwpv1TJKXB4PJD Xg6A== X-Gm-Message-State: AMCzsaUm06v7S9all5y+Ng5IH9RnzW/Cs3A/mCEBAU5oyl9dPr5ATkvv Ks/Vu1yjdvZwunHMWV+VC93uFg== X-Google-Smtp-Source: AOwi7QAwxWUMw6fwak5vZYThm7GA87MPd0kHT1I+1fiJCvE2B1pq6xgBGU86e8nJ41+8opQPtDJoKg== X-Received: by 10.159.204.147 with SMTP id t19mr5302819plo.242.1508035014230; Sat, 14 Oct 2017 19:36:54 -0700 (PDT) Received: from calancha-pc (203.191.218.133.dy.bbexcite.jp. [133.218.191.203]) by smtp.gmail.com with ESMTPSA id y10sm8097950pfl.186.2017.10.14.19.36.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Oct 2017 19:36:53 -0700 (PDT) Date: Sun, 15 Oct 2017 11:36:44 +0900 Message-Id: <87y3od2l37.fsf@gmail.com> To: control@debbugs.gnu.org From: Tino Calancha Subject: control message for bug #28834 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) severity 28834 wishlist From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 14 22:40:11 2017 Received: (at control) by debbugs.gnu.org; 15 Oct 2017 02:40:11 +0000 Received: from localhost ([127.0.0.1]:40801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3YqZ-0007kg-4s for submit@debbugs.gnu.org; Sat, 14 Oct 2017 22:40:11 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:44403) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3YqX-0007kT-1K for control@debbugs.gnu.org; Sat, 14 Oct 2017 22:40:09 -0400 Received: by mail-pf0-f193.google.com with SMTP id x7so13269545pfa.1 for ; Sat, 14 Oct 2017 19:40:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:to:from:subject; bh=Ryc9jI2EGvenehJ0tRG6eYp84NMUp/1UhWeGy1dW+bg=; b=oyCXxOL89k1OrSmT4bmGL67+QYlrLp/ZzgfJAN4IoWG12cVGOgft1Ww0jfSoVU0gLp kS3GlP9qHCSqqDb1b3cDSqedtveA7+jSjnu9HdLsYbx/8Lf0KEKjGdCKbDpH4hG/Xqc4 DyHqjFwOZPed+0D+q3gtTdmG49rtWIByLNeHYzx2ogxGaNMX7O8uYLbwCK3WMQR1XHGA 3wRMweD6HKj75rQSsLDGl4K2aWvV9YVMSkOFIpcdSbms5sYo2mlnQFYyuXfqdp4PVGin son00vl+A56Nd7lLxdULiJ+5LnoH6JmiA4WKvHYOdAmtgHQS5hchf31BHpMzEhHGHpOz pnUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:to:from:subject; bh=Ryc9jI2EGvenehJ0tRG6eYp84NMUp/1UhWeGy1dW+bg=; b=M/1sl4UVT7w5p+IkU3p/cP6QVMxtj+3mmO9edtDaKdVZPXeLt3QXTA9d0U2W8C40s1 bkfr+K47aSYb0CCiblpZPUpFvwFRcG5qecjaCjlDzGExEnTXYKe77fodXUEuLnpQTHMV CKUjDOcq9ZYf7QV5zcRrr0iu4KgoCtruXwldx9yScUEn8n3QWEgbwMnw4Hb9qXuuMiQ/ P0ZBTA0WXOFnHJdmSsYqLYp0t6Ihckgr09rzRE+NzOtWvlnPZCwqNMXb21dMEQ1RcY7p c1oiBtbgpzc4b/sC3ohZTTNHs3gbbT0IAh+PRmuuhVTFrQntKGlOtFgwxDt29q/BXDc7 ekCw== X-Gm-Message-State: AMCzsaXi0o43g+8trt62CET86rtV0SMlC/719nFeikqWOhOTRTi+GlxT z54poF7qZlo6gUxlIEV1TFAWQA== X-Google-Smtp-Source: AOwi7QDL1FRESyGyfn0j+0IpYdjJyZBLlfdslI/MerJLUDLC2huBQy8VgbVKGvPElGXwvzgGvjInBg== X-Received: by 10.84.134.34 with SMTP id 31mr5357074plg.124.1508035203221; Sat, 14 Oct 2017 19:40:03 -0700 (PDT) Received: from calancha-pc (203.191.218.133.dy.bbexcite.jp. [133.218.191.203]) by smtp.gmail.com with ESMTPSA id j1sm8794576pfj.108.2017.10.14.19.40.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Oct 2017 19:40:02 -0700 (PDT) Date: Sun, 15 Oct 2017 11:40:00 +0900 Message-Id: <87wp3x2kxr.fsf@gmail.com> To: control@debbugs.gnu.org From: Tino Calancha Subject: control message for bug #28834 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) retitle 28834 25.1; dired-do-copy: allow to copy into a nonexistent directory From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 00:43:03 2017 Received: (at 28834) by debbugs.gnu.org; 15 Oct 2017 04:43:03 +0000 Received: from localhost ([127.0.0.1]:40845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3alT-0004C8-6W for submit@debbugs.gnu.org; Sun, 15 Oct 2017 00:43:03 -0400 Received: from mail-pg0-f50.google.com ([74.125.83.50]:50426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3alR-0004Bf-PJ for 28834@debbugs.gnu.org; Sun, 15 Oct 2017 00:43:02 -0400 Received: by mail-pg0-f50.google.com with SMTP id y7so4245621pgb.7 for <28834@debbugs.gnu.org>; Sat, 14 Oct 2017 21:43:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=zwYpaBJj9ko9WGFvku37/jeVfzQhKt8HrN9EkrqxiKA=; b=oxGBjZGO90/O19NdX7HWHZtTqBHlRQPbEKWG3ozV8RLkshaZSJ2yboAu4ONhQHS5bw QYtGqEgSGnXME/YOc/UOTh/yZTckzMa0Q8W2rewoBNqVKIrSXIOPuKwtYZIzTsakoyGK 41QFL6OnBtYLkS6YhgLhamvRPyBcm53O9iC16uJ0SBamdjikxsONdb9AiAfBFJSfa5s2 KkNwus6cecgGHH64GhWAWK5cGUv/cMcjtW+QbcDOca7lIxBkC6rw7IrXnSH82bdfrghN MWOyXcOYk+Wj5XxaZABbuQ/5Ts7T3wYEDWL/e2pebV+YX79dHC/UCk6TNLge03/ytzRJ HxaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=zwYpaBJj9ko9WGFvku37/jeVfzQhKt8HrN9EkrqxiKA=; b=fz0D8e2dW+bhOx0SSr/w7dmVXmHbzkbVv4TDKujmQ9fy5RGHuPcmGQiwYYcffV34Nm QwlkSVtW11Z3RCog8Migpu0Cs6Y+eaOwcOru4OJJSVeZDgYb/1+BX/42nPkyLixeMRM1 1rYD4a32JBKqOfPQPCulZ/Kk2nFRsPc6MG7/eFFbMxrXVn4qaSdtl+o6BElQklnITcow 1wjjZT0qKFWxGv1yxezp6WNrYRhoOQ/5kgCakJ/WkK4ZPP7BX40UCjFcQs9ia1ZZzSTY viAWGMwBwIRlezbM9HwIKMbV2f5+eP42H5eKfXVbPdgW2HrpcsGmJoBmVmD7a4qpS0DV Xw4Q== X-Gm-Message-State: AMCzsaVmSQPJJriA3YPZkDPecoE5InWm0mQCo7JqAefrxdItwSjuavoW OcOpaAURAV73PFCRhOL6w+A= X-Google-Smtp-Source: ABhQp+SsSqbgY8xYg7Xj+RnKT/SHCjZ7bi9CBfCCUup6XcRwu/apOQm9BLaeZKwGVJBdK3D4m93YFw== X-Received: by 10.98.60.198 with SMTP id b67mr8443pfk.163.1508042575721; Sat, 14 Oct 2017 21:42:55 -0700 (PDT) Received: from calancha-pc (203.191.218.133.dy.bbexcite.jp. [133.218.191.203]) by smtp.gmail.com with ESMTPSA id f3sm8963322pfd.82.2017.10.14.21.42.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Oct 2017 21:42:54 -0700 (PDT) From: Tino Calancha To: 28834@debbugs.gnu.org Subject: Re: bug#28834: 25.1; dired-do-copy: allow to copy into a nonexistent directory References: <006201d344da$d9316a50$8b943ef0$@gmail.com> Date: Sun, 15 Oct 2017 13:42:48 +0900 In-Reply-To: <006201d344da$d9316a50$8b943ef0$@gmail.com> (alexei's message of "Sat, 14 Oct 2017 13:54:45 +0300") Message-ID: <87shel2f93.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 28834 Cc: Eli Zaretskii , Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) "alexei28" writes: > I want to copy file from "d:/TEMP/test/test.txt" to nonexistent directory= "d:/TEMP/test/new/" with Dired > Copy =E2=80=98d:/TEMP/test/test.txt=E2=80=99 to =E2=80=98d:/TEMP/test/new= /test.txt=E2=80=99 failed: > > (file-error Copying file Operation not permitted d:/TEMP/test/test.txt d:= /TEMP/test/new/test.txt) > > It would be good if Emacs can autocreate not exist directory when copy/mo= ve files. It might has sense that Dired handle the creation of those destination dirs. WDOT? --8<-----------------------------cut here---------------start------------->= 8--- commit 1325ea21a069b5c539157390fb5df2eca76adecb Author: Tino Calancha Date: Sun Oct 15 13:34:08 2017 +0900 Dired: Allow to copy/rename files into a non-existent dir =20=20=20=20 * lisp/dired-aux.el (dired--create-dirs): New defun. (dired-copy-file-recursive, dired-rename-file): Use it (Bug#28834). * doc/emacs/dired.texi (Operating on Files): Update manual. * etc/NEWS (Changes in Specialized Modes and Packages in Emacs 27.1) Announce feature. * lisp/dired-aux-tests.el (dired-test-bug28834): Add test. diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index db5dea329b..48013a3221 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -645,7 +645,8 @@ Operating on Files @item C @var{new} @key{RET} Copy the specified files (@code{dired-do-copy}). The argument @var{new} is the directory to copy into, or (if copying a single file) the new -name. This is like the shell command @code{cp}. +name. Dired creates any non-existent directories in @var{new}. This is +like the shell command @code{cp}. =20 @vindex dired-copy-preserve-time If @code{dired-copy-preserve-time} is non-@code{nil}, then copying @@ -674,7 +675,8 @@ Operating on Files @cindex moving files (in Dired) @item R @var{new} @key{RET} Rename the specified files (@code{dired-do-rename}). If you rename a -single file, the argument @var{new} is the new name of the file. If +single file, the argument @var{new} is the new name of the file. Dired +creates any non-existent directories in @var{new}. If you rename several files, the argument @var{new} is the directory into which to move the files (this is like the shell command @command{mv}). =20 diff --git a/etc/NEWS b/etc/NEWS index 716b0309a5..08291fc39f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -56,6 +56,12 @@ whether '"' is also replaced in 'electric-quote-mode'. = If non-nil, * Changes in Specialized Modes and Packages in Emacs 27.1 =20 +** Dired + +--- +*** dired-do-copy and dired-rename-file now create non-existent +directories in the destination. + ** Edebug =20 +++ diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 7e2252fcf1..fcea8f1b13 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1548,6 +1548,10 @@ dired-copy-file =20 (declare-function make-symbolic-link "fileio.c") =20 +(defun dired--create-dirs (dir) + (unless (file-exists-p dir) + (dired-create-directory dir))) + (defun dired-copy-file-recursive (from to ok-flag &optional preserve-time top recursive) (when (and (eq t (car (file-attributes from))) @@ -1564,6 +1568,7 @@ dired-copy-file-recursive (if (stringp (car attrs)) ;; It is a symlink (make-symbolic-link (car attrs) to ok-flag) + (dired--create-dirs (file-name-directory to)) (copy-file from to ok-flag preserve-time)) (file-date-error (push (dired-make-relative from) @@ -1573,6 +1578,7 @@ dired-copy-file-recursive ;;;###autoload (defun dired-rename-file (file newname ok-if-already-exists) (dired-handle-overwrite newname) + (dired--create-dirs (file-name-directory newname)) (rename-file file newname ok-if-already-exists) ; error is caught in -cr= eate-files ;; Silently rename the visited file of any buffer visiting this file. (and (get-file-buffer file) diff --git a/test/lisp/dired-aux-tests.el b/test/lisp/dired-aux-tests.el index d41feb1592..d8114d8401 100644 --- a/test/lisp/dired-aux-tests.el +++ b/test/lisp/dired-aux-tests.el @@ -40,5 +40,25 @@ (should-not (dired-do-shell-command "ls ? ./`?`" nil files))) (delete-file foo)))) =20 +(ert-deftest dired-test-bug28834 () + "test for https://debbugs.gnu.org/28834 ." + (let* ((from (make-temp-file "from")) + (foo (make-temp-file "foo" 'dir)) + (bar (file-name-as-directory (expand-file-name "bar" foo))) + (qux (file-name-as-directory (expand-file-name "qux" foo))) + (tmpdir temporary-file-directory) + (to-cp (expand-file-name "foo-cp" bar)) + (to-mv (expand-file-name "foo-mv" qux))) + (unwind-protect + (progn + (dired-copy-file-recursive from to-cp nil) + (should (file-exists-p to-cp)) + (dired-rename-file from to-mv nil) + (should (file-exists-p to-mv))) + ;; clean up + (delete-directory foo 'recursive) + (delete-file from)))) + + (provide 'dired-aux-tests) ;; dired-aux-tests.el ends here --8<-----------------------------cut here---------------end--------------->= 8--- In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-10-15 Repository revision: eed3a3d9e95d2c5346a23c9d92ca4e5848330183 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 00:43:20 2017 Received: (at control) by debbugs.gnu.org; 15 Oct 2017 04:43:20 +0000 Received: from localhost ([127.0.0.1]:40848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3alk-0004Cg-LR for submit@debbugs.gnu.org; Sun, 15 Oct 2017 00:43:20 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:47271) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3alj-0004CR-Li for control@debbugs.gnu.org; Sun, 15 Oct 2017 00:43:19 -0400 Received: by mail-pf0-f170.google.com with SMTP id z11so13360758pfk.4 for ; Sat, 14 Oct 2017 21:43:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:to:from:subject; bh=/j3V6mwj7t6SErduSgGwZalYENdxBFc4CZDVZbcWR9A=; b=QqA4jky8Ugu7qAmwAX6I+oQRJm+fcIdtqCJL/UdQWhbmvDXX0nLXe2pPPVr93JzPDn jDw4/LFlyztjRpn2omfaeQ2h9kkuQ90Jgh68IMRmj3bQG7iTpPdX5LL3jPQ12YgVGkBE 3o0E+kEyVDaxs+6IDTDPih4GAXocgLW5EK8xpU5o0Cq3eGLh8VFQ/FujpSbitugw2jq/ Q8MzbBHmrLEVub8Hvq1Cv7GHhVDi01RWpvuvh7OeapKRPg7aPdCRkxdExmGWNZNs6zTb iFsORP+uW3/yg5WY8Udpsh9vwE6hO69JWEY9e/cJr1W8VzFyGSAWfYyKn0hbmqKLuMFR dJ6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:to:from:subject; bh=/j3V6mwj7t6SErduSgGwZalYENdxBFc4CZDVZbcWR9A=; b=GS84jk69E6DS7/KyN5eAdDp1PtjFrr0crHo5dUR063/NTmcgjRievlTGgyJt0fdjCP 9z3mscGwIC8GK7fwh7nPhPpR+LCTC4d6+6ZPteJyKtYP42w6Tfbr+DrlyAEMplY3zNtM rGb2BvP7krf1ZD15qLX01h8O9ZW9LGxbAgSohopy8WP67SBX34ZSJfT7cAjkmf+R4sN6 +1yC6oS7rqQd6yXcubce9IulRLfIv3jpauozu1zexpEkytFZYeH51PG6KMU8jEXsLv5J mJMoSiQM5VdZ+RhmKZefe0hx+U/tDQIpHdOZCqqrA48nbv6gWzxb2d3UnREQjfYUundg 3QsA== X-Gm-Message-State: AMCzsaVqCekw5rw9oVCjasgd7cPmVYBtIeO6MfWUV49X3mV+qnlqH2rV wjfsvIfXrbr7cwBKv8k13E8YdA== X-Google-Smtp-Source: AOwi7QDUpK4AJ/qCpoAcRmLuqnTOerXjSTCl2gCN4N5uq0sqjx4ueg5LU5DS85u4Daz8OUEtRPodTg== X-Received: by 10.159.216.131 with SMTP id s3mr5442958plp.432.1508042593930; Sat, 14 Oct 2017 21:43:13 -0700 (PDT) Received: from calancha-pc (203.191.218.133.dy.bbexcite.jp. [133.218.191.203]) by smtp.gmail.com with ESMTPSA id p70sm9345885pfk.130.2017.10.14.21.43.12 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Oct 2017 21:43:13 -0700 (PDT) Date: Sun, 15 Oct 2017 13:43:11 +0900 Message-Id: <87r2u52f8g.fsf@gmail.com> To: control@debbugs.gnu.org From: Tino Calancha Subject: control message for bug #28834 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) tags 28834 patch From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 10:21:39 2017 Received: (at 28834) by debbugs.gnu.org; 15 Oct 2017 14:21:39 +0000 Received: from localhost ([127.0.0.1]:41752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3jnO-000801-Uf for submit@debbugs.gnu.org; Sun, 15 Oct 2017 10:21:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52879) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3jnN-0007zn-3Y for 28834@debbugs.gnu.org; Sun, 15 Oct 2017 10:21:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3jnH-0007Rm-9t for 28834@debbugs.gnu.org; Sun, 15 Oct 2017 10:21:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3jnA-0007GK-Lj; Sun, 15 Oct 2017 10:21:24 -0400 Received: from [176.228.60.248] (port=4624 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e3jnA-0000Jm-2u; Sun, 15 Oct 2017 10:21:24 -0400 Date: Sun, 15 Oct 2017 17:21:21 +0300 Message-Id: <83tvz0h4pq.fsf@gnu.org> From: Eli Zaretskii To: Tino Calancha In-reply-to: <87shel2f93.fsf@gmail.com> (message from Tino Calancha on Sun, 15 Oct 2017 13:42:48 +0900) Subject: Re: bug#28834: 25.1; dired-do-copy: allow to copy into a nonexistent directory References: <006201d344da$d9316a50$8b943ef0$@gmail.com> <87shel2f93.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28834 Cc: 28834@debbugs.gnu.org, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Tino Calancha > Cc: Eli Zaretskii , Drew Adams > Date: Sun, 15 Oct 2017 13:42:48 +0900 > > It might has sense that Dired handle the creation of those destination dirs. > WDOT? I think, if we accept this, it must be an optional feature, by default off. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 10:47:58 2017 Received: (at 28834) by debbugs.gnu.org; 15 Oct 2017 14:47:58 +0000 Received: from localhost ([127.0.0.1]:41762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3kCs-0000Eu-Bx for submit@debbugs.gnu.org; Sun, 15 Oct 2017 10:47:58 -0400 Received: from mail-pg0-f46.google.com ([74.125.83.46]:46965) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3kCq-0000Ec-GM for 28834@debbugs.gnu.org; Sun, 15 Oct 2017 10:47:57 -0400 Received: by mail-pg0-f46.google.com with SMTP id k7so4815746pga.3 for <28834@debbugs.gnu.org>; Sun, 15 Oct 2017 07:47:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=oCO+0a+ETp1pX89ZTmAVFMgd9mVBNFuu3fsSzuGofeM=; b=WZrpZ7UjqJ1lPeWJKkp7CdgOIEV62oqVYyIukQxy+rWW/W0RcD6SpfHDMhFWHAjiHz 7jCwZ56O4M6KKIcKlgvkCcKH8uuErH/Z672SJzoanhXr5T63j2u8dtawi34gQOvXHZqR g1JXre/e8tj/v6ZMPFIraudECC2uoyBFIYpNrDHF/OXBs/emMkyYtebSxZKNEVo4wBzK ++p8//XKq68m5BO2YYJ1VY3zO5HmEtZqub8UIczvUHF8b+qpZzTqdYGGN2bZ8qn/Xw73 XMNPg70qDp1wlmM4DVTF2ZwDDITgeh/WzZxWjaB4nSjDgkhAsOXfPf9l/tg6XTYtY/5E nNoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=oCO+0a+ETp1pX89ZTmAVFMgd9mVBNFuu3fsSzuGofeM=; b=U1PfGMNksghx/2f2N7YLBKiEm8MaAVznc3fUyGyZ/thi7A/CmDOk9NXjcSVwvkfwvu 7FQQoWh0MKoEr3wKLpOfrm9o+Bis3PH82FvVxMIYmoRkbz/W1swS2UUA8yON0YT0O7rq 9+/Pi8eHTwmDXUJDatXEW95UvmGBfi1xr8LXt2GwL2bs0N+J6XOdQdZ2vVmJPPgrXiBT /t4Jpu6mGzN/dQ1KCe+2nez9FSKpE2hltg1kWKRkiKF7ENJFGow2JQ66od5DH1Fq8uZz Ss640DPunSy847dcB07eJpYBP2yL8Dq+gnYNyGOf/esjsXWumBK/dxkmN7/kr4gh80Cs lO2g== X-Gm-Message-State: AMCzsaVb5fBfiPkJvRcJMLmTAWU2aFsx8HsOuYTvB5q6xdEuVzmdHuWr qz0h55ENbN7l3QU+87D00ak= X-Google-Smtp-Source: AOwi7QCPdc7V+gKqLCMLireqHkj6HCk3+Q7rePWQuD1Chy8rv4orvZYmKiP3ahPWA2ZRJFii4oNrqQ== X-Received: by 10.84.179.36 with SMTP id a33mr6180941plc.99.1508078870175; Sun, 15 Oct 2017 07:47:50 -0700 (PDT) Received: from calancha-pc (203.191.218.133.dy.bbexcite.jp. [133.218.191.203]) by smtp.gmail.com with ESMTPSA id b3sm9889802pgr.81.2017.10.15.07.47.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Oct 2017 07:47:49 -0700 (PDT) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Sun, 15 Oct 2017 23:47:45 +0900 (JST) X-X-Sender: calancha@calancha-pc To: Eli Zaretskii Subject: Re: bug#28834: 25.1; dired-do-copy: allow to copy into a nonexistent directory In-Reply-To: <83tvz0h4pq.fsf@gnu.org> Message-ID: References: <006201d344da$d9316a50$8b943ef0$@gmail.com> <87shel2f93.fsf@gmail.com> <83tvz0h4pq.fsf@gnu.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 28834 Cc: 28834@debbugs.gnu.org, drew.adams@oracle.com, Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Sun, 15 Oct 2017, Eli Zaretskii wrote: >> From: Tino Calancha >> Cc: Eli Zaretskii , Drew Adams >> Date: Sun, 15 Oct 2017 13:42:48 +0900 >> >> It might has sense that Dired handle the creation of those destination dirs. >> WDOT? > > I think, if we accept this, it must be an optional feature, by default > off. Sounds good to me. I will prepare a new patch tomorrow. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 11:43:42 2017 Received: (at 28834) by debbugs.gnu.org; 15 Oct 2017 15:43:42 +0000 Received: from localhost ([127.0.0.1]:41817 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3l4o-0001hC-38 for submit@debbugs.gnu.org; Sun, 15 Oct 2017 11:43:42 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:36902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3l4m-0001gv-52 for 28834@debbugs.gnu.org; Sun, 15 Oct 2017 11:43:40 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v9FFhXJH006408 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 15 Oct 2017 15:43:34 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v9FFhXZh022553 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 15 Oct 2017 15:43:33 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v9FFhXMP026751; Sun, 15 Oct 2017 15:43:33 GMT MIME-Version: 1.0 Message-ID: <329916c9-5a00-4460-83db-f16b98e79edb@default> Date: Sun, 15 Oct 2017 08:43:32 -0700 (PDT) From: Drew Adams To: Tino Calancha , 28834@debbugs.gnu.org Subject: RE: bug#28834: 25.1; dired-do-copy: allow to copy into a nonexistent directory References: <006201d344da$d9316a50$8b943ef0$@gmail.com> <87shel2f93.fsf@gmail.com> In-Reply-To: <87shel2f93.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4600.0 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: 28834 Cc: Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) > > I want to copy file from "d:/TEMP/test/test.txt" to nonexistent > > directory "d:/TEMP/test/new/" with Dired > > Copy =E2=80=98d:/TEMP/test/test.txt=E2=80=99 to =E2=80=98d:/TEMP/test/n= ew/test.txt=E2=80=99 failed: > > > > (file-error Copying file Operation not permitted d:/TEMP/test/test.txt > d:/TEMP/test/new/test.txt) > > > > It would be good if Emacs can autocreate not exist directory when > > copy/move files. >=20 > It might has sense that Dired handle the creation of those destination > dirs. WDOT? The enhancement request is "It would be good if Emacs CAN autocreate not exist directory when copy/move files." The operative word here is "CAN". A change to _always_ create missing dirs would be inappropriate. (I have not looked at your patch in detail.) It is important that Dired not just create dirs on its own, especially since that would be an incompatible behavior change, and also because it would mean also creating "missing dirs" as a result of a user making a typing mistake. At the very least, users should be able to control this by way of confirming. What should be done is to offer users the POSSIBILITY of having Dired create the missing directories. This can be done in various ways: 1. Have a different command, which users can bind in place of the existing command. 2. Have a user option that controls whether Dired creates missing dirs by default, i.e., without confirmation. 3. Have Dired ask whether to create missing directories. I think probably 2+3 would be good: have Dired prompt when dirs are missing, but have an option that lets users who never want to be prompted bypass prompting. The option could be 3-valued: `always-prompt', `always-create', `never-create' (or other names). From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 23:47:25 2017 Received: (at 28834) by debbugs.gnu.org; 16 Oct 2017 03:47:25 +0000 Received: from localhost ([127.0.0.1]:42259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3wNA-00020C-HA for submit@debbugs.gnu.org; Sun, 15 Oct 2017 23:47:25 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:47828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3wN7-0001zu-Em for 28834@debbugs.gnu.org; Sun, 15 Oct 2017 23:47:23 -0400 Received: by mail-pg0-f65.google.com with SMTP id r25so5755334pgn.4 for <28834@debbugs.gnu.org>; Sun, 15 Oct 2017 20:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=qTPLcSSjNcSsqs7jcH97aFKuP2jc4v/xZmfOTUaAAmE=; b=jUhdiZ2dS0TP9kYp7RiACVylmfiDwpxttK7eBSjU5P9m2NTlnqlhzGM4w1JywVz8ag vv9hf0bbFrmaBYJz1s6XHuIMGETmpUEiL41mJgRem2UYP92bPBwldMhaB43YK+R05ZDi Nr3Bmjik5s3dv5B/FQIvF6Pmpkf5NYBNcIlr3ZgeV4s9dQCEdlAuxvIRM5XXX9ymtAWd APnbT2KfogKbrdLbDoPj6IiBkuok34l8TK+jID0Yst5q1i7oaNcATF54wr+wksSj7HJq 1E2Xa4zdm3mvpB0xbi1B8mzEhmdtXNpGlJP34JJiwR9k3m/ayOqssI2NxCvoF6RicTKF i5dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=qTPLcSSjNcSsqs7jcH97aFKuP2jc4v/xZmfOTUaAAmE=; b=RAz7lV9A7LiKQ4mCkwIjOaft7sljk64oWhAbQsktMrwxFEd+kX/Lf3MoynB8SuKs1B Nq8jZFmvfqSY/kp0OTt2MxWlnLqWcdHGh8/xW14o2j2LZerMX8tIb0e0V1oslxjm+0q9 LWl529I5WYh9XCFrfpgOT6QFjnz4VCZF1OROToaKdaSUaGFD4ZYeG8+zwLIdtJSM9Cqw WuUIhcs20ESpdEGUuYdtLH7bQ/4d6TUWBOs9tGnmbcREiYAfWNAROpdJkzlB9isSgIAq j7Ozm34z5vZbyok97l7G2WstrVyoIm3ID28YWJMmrny8ruNME8L4Y+y0V9cBK33OE/LQ SWKQ== X-Gm-Message-State: AMCzsaUsCMgJQ6gk1Zin+bocPu8MJFK93LqwEFQbEtamXwvaOmZzv8HL 1P+g9UPZgjZ0SOiYK2BnyEk= X-Google-Smtp-Source: AOwi7QAIVbVHIRAjn29tTfEYc5TfU4XLTRwmLAXm8ZeUh9NEqxsG7aC+LsrJGnXXJBWhPutZXmBf8Q== X-Received: by 10.99.107.73 with SMTP id g70mr6955411pgc.279.1508125634782; Sun, 15 Oct 2017 20:47:14 -0700 (PDT) Received: from calancha-pc (203.191.218.133.dy.bbexcite.jp. [133.218.191.203]) by smtp.gmail.com with ESMTPSA id k10sm9616669pgq.92.2017.10.15.20.47.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 15 Oct 2017 20:47:14 -0700 (PDT) From: Tino Calancha To: Drew Adams Subject: Re: bug#28834: 25.1; dired-do-copy: allow to copy into a nonexistent directory References: <006201d344da$d9316a50$8b943ef0$@gmail.com> <87shel2f93.fsf@gmail.com> <329916c9-5a00-4460-83db-f16b98e79edb@default> Date: Mon, 16 Oct 2017 12:47:06 +0900 In-Reply-To: <329916c9-5a00-4460-83db-f16b98e79edb@default> (Drew Adams's message of "Sun, 15 Oct 2017 08:43:32 -0700 (PDT)") Message-ID: <87mv4r3gat.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 28834 Cc: Eli Zaretskii , 28834@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Drew Adams writes: > The enhancement request is "It would be good if Emacs CAN > autocreate not exist directory when copy/move files." > > The operative word here is "CAN". > This can be done in various ways: > > 1. Have a different command, which users can bind in > place of the existing command. > > 2. Have a user option that controls whether Dired creates > missing dirs by default, i.e., without confirmation. > > 3. Have Dired ask whether to create missing directories. > > I think probably 2+3 would be good: have Dired prompt > when dirs are missing, but have an option that lets > users who never want to be prompted bypass prompting. > The option could be 3-valued: `always-prompt', > `always-create', `never-create' (or other names). Thank you for the explanation. Let's discuss the updated patch: --8<-----------------------------cut here---------------start------------->8--- commit b656651e9268f5dd646933b992bd37771c3e99ca Author: Tino Calancha Date: Mon Oct 16 12:41:41 2017 +0900 Allow to copy/rename file into a non-existent dir * lisp/dired-aux.el (dired-create-destination-dirs): New option. (dired--create-nonexistent-dirs): New defun. (dired-copy-file-recursive, dired-rename-file): Use it (Bug#28834). * lisp/dired-aux-tests.el (dired-test-bug28834): Add test. * doc/emacs/dired.texi (Operating on Files): Update manual. * etc/NEWS (Changes in Specialized Modes and Packages in Emacs 27.1) Announce this change. diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index db5dea329b..0f37ac60ac 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -646,6 +646,16 @@ Operating on Files Copy the specified files (@code{dired-do-copy}). The argument @var{new} is the directory to copy into, or (if copying a single file) the new name. This is like the shell command @code{cp}. +The option @var{dired-create-destination-dirs} controls whether Dired +should create non-existent directories in @var{new}. + +@videnx dired-create-destination-dirs +The option @code{dired-create-destination-dirs} controls whether Dired +should create non-existent directories in the destination while +copying/renaming files. The default value @code{never} means Dired +never creates such missing directories; the value @code{always}, +means Dired automatically creates them; the value @code{prompt} +means Dired asks you for confirmation before creating them. @vindex dired-copy-preserve-time If @code{dired-copy-preserve-time} is non-@code{nil}, then copying @@ -678,6 +688,9 @@ Operating on Files you rename several files, the argument @var{new} is the directory into which to move the files (this is like the shell command @command{mv}). +The option @var{dired-create-destination-dirs} controls whether Dired +should create non-existent directories in @var{new}. + Dired automatically changes the visited file name of buffers associated with renamed files so that they refer to the new names. diff --git a/etc/NEWS b/etc/NEWS index 716b0309a5..e5cec45426 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -56,6 +56,13 @@ whether '"' is also replaced in 'electric-quote-mode'. If non-nil, * Changes in Specialized Modes and Packages in Emacs 27.1 +** Dired + +--- +*** The new user option 'dired-create-destination-dirs' controls whether +'dired-do-copy' and 'dired-rename-file' must create non-existent +directories in the destination. + ** Edebug +++ diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 7e2252fcf1..0e415b7738 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1548,6 +1548,26 @@ dired-copy-file (declare-function make-symbolic-link "fileio.c") +(defcustom dired-create-destination-dirs 'never + "Whether Dired should create destination dirs when copying/removing files. +If never, don't create them. +If always, create them without ask. +If prompt, ask for user confirmation." + :type '(choice (const :tag "Never create non-existent dirs" never) + (const :tag "Always create non-existent dirs" always) + (const :tag "Ask for user confirmation" prompt)) + :group 'dired + :version "27.1") + +(defun dired--create-dirs (dir) + (unless (file-exists-p dir) + (pcase dired-create-destination-dirs + ('never nil) + ('always (dired-create-directory dir)) + ('prompt + (when (yes-or-no-p (format "Create destination dir '%s'? " dir)) + (dired-create-directory dir)))))) + (defun dired-copy-file-recursive (from to ok-flag &optional preserve-time top recursive) (when (and (eq t (car (file-attributes from))) @@ -1564,6 +1584,7 @@ dired-copy-file-recursive (if (stringp (car attrs)) ;; It is a symlink (make-symbolic-link (car attrs) to ok-flag) + (dired--create-dirs (file-name-directory to)) (copy-file from to ok-flag preserve-time)) (file-date-error (push (dired-make-relative from) @@ -1573,6 +1594,7 @@ dired-copy-file-recursive ;;;###autoload (defun dired-rename-file (file newname ok-if-already-exists) (dired-handle-overwrite newname) + (dired--create-dirs (file-name-directory newname)) (rename-file file newname ok-if-already-exists) ; error is caught in -create-files ;; Silently rename the visited file of any buffer visiting this file. (and (get-file-buffer file) diff --git a/test/lisp/dired-aux-tests.el b/test/lisp/dired-aux-tests.el index d41feb1592..7778db0ea4 100644 --- a/test/lisp/dired-aux-tests.el +++ b/test/lisp/dired-aux-tests.el @@ -40,5 +40,34 @@ (should-not (dired-do-shell-command "ls ? ./`?`" nil files))) (delete-file foo)))) +(ert-deftest dired-test-bug28834 () + "test for https://debbugs.gnu.org/28834 ." + (let* ((from (make-temp-file "from")) + (foo (make-temp-file "foo" 'dir)) + (bar (file-name-as-directory (expand-file-name "bar" foo))) + (qux (file-name-as-directory (expand-file-name "qux" foo))) + (tmpdir temporary-file-directory) + (to-cp (expand-file-name "foo-cp" bar)) + (to-mv (expand-file-name "foo-mv" qux)) + (dired-create-destination-dirs 'always)) + (unwind-protect + (progn + (dired-copy-file-recursive from to-cp nil) + (should (file-exists-p to-cp)) + (dired-rename-file from to-mv nil) + (should (file-exists-p to-mv)) + ;; Repeat the same with `dired-create-destination-dirs' set to 'never. + (dired-rename-file to-mv from nil) + (delete-file to-cp) + (delete-directory bar) + (delete-directory qux) + (let ((dired-create-destination-dirs 'never)) + (should-error (dired-copy-file-recursive from to-cp nil)) + (should-error (dired-rename-file from to-mv nil)))) + ;; clean up + (delete-directory foo 'recursive) + (delete-file from)))) + + (provide 'dired-aux-tests) ;; dired-aux-tests.el ends here --8<-----------------------------cut here---------------end--------------->8--- In GNU Emacs 27.0.50 (build 11, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-10-16 Repository revision: eed3a3d9e95d2c5346a23c9d92ca4e5848330183 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 12:12:43 2017 Received: (at 28834) by debbugs.gnu.org; 16 Oct 2017 16:12:43 +0000 Received: from localhost ([127.0.0.1]:44067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e480R-00034r-1g for submit@debbugs.gnu.org; Mon, 16 Oct 2017 12:12:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e480O-00034b-7I for 28834@debbugs.gnu.org; Mon, 16 Oct 2017 12:12:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e480F-00074P-3d for 28834@debbugs.gnu.org; Mon, 16 Oct 2017 12:12:35 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e480F-00074F-0q; Mon, 16 Oct 2017 12:12:31 -0400 Received: from [176.228.60.248] (port=2003 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e480E-0005oF-8D; Mon, 16 Oct 2017 12:12:30 -0400 Date: Mon, 16 Oct 2017 19:12:12 +0300 Message-Id: <83o9p7f4wz.fsf@gnu.org> From: Eli Zaretskii To: Tino Calancha In-reply-to: <87mv4r3gat.fsf@gmail.com> (message from Tino Calancha on Mon, 16 Oct 2017 12:47:06 +0900) Subject: Re: bug#28834: 25.1; dired-do-copy: allow to copy into a nonexistent directory References: <006201d344da$d9316a50$8b943ef0$@gmail.com> <87shel2f93.fsf@gmail.com> <329916c9-5a00-4460-83db-f16b98e79edb@default> <87mv4r3gat.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28834 Cc: 28834@debbugs.gnu.org, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Tino Calancha > Cc: 28834@debbugs.gnu.org, Eli Zaretskii > Date: Mon, 16 Oct 2017 12:47:06 +0900 > > Thank you for the explanation. Let's discuss the updated patch: Thanks, I have a few comments: > diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi > index db5dea329b..0f37ac60ac 100644 > --- a/doc/emacs/dired.texi > +++ b/doc/emacs/dired.texi > @@ -646,6 +646,16 @@ Operating on Files > Copy the specified files (@code{dired-do-copy}). The argument @var{new} > is the directory to copy into, or (if copying a single file) the new > name. This is like the shell command @code{cp}. > +The option @var{dired-create-destination-dirs} controls whether Dired > +should create non-existent directories in @var{new}. This sentence is redundant (repeated right after it), and also uses @var incorrectly. > +@videnx dired-create-destination-dirs ^^^^^^^ A typo. > +The option @code{dired-create-destination-dirs} controls whether Dired > +should create non-existent directories in the destination while > +copying/renaming files. The default value @code{never} means Dired > +never creates such missing directories; the value @code{always}, > +means Dired automatically creates them; the value @code{prompt} > +means Dired asks you for confirmation before creating them. I think we generally use 'ask', not 'prompt' in these cases. > diff --git a/etc/NEWS b/etc/NEWS > index 716b0309a5..e5cec45426 100644 > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -56,6 +56,13 @@ whether '"' is also replaced in 'electric-quote-mode'. If non-nil, > > * Changes in Specialized Modes and Packages in Emacs 27.1 > > +** Dired > + > +--- Since you've updated the manual, this should be "+++", not "---". > +*** The new user option 'dired-create-destination-dirs' controls whether > +'dired-do-copy' and 'dired-rename-file' must create non-existent ^^^^ "Should", not "must". > +directories in the destination. > + > ** Edebug > > +++ > diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el > index 7e2252fcf1..0e415b7738 100644 > --- a/lisp/dired-aux.el > +++ b/lisp/dired-aux.el > @@ -1548,6 +1548,26 @@ dired-copy-file > > (declare-function make-symbolic-link "fileio.c") > > +(defcustom dired-create-destination-dirs 'never > + "Whether Dired should create destination dirs when copying/removing files. > +If never, don't create them. > +If always, create them without ask. > +If prompt, ask for user confirmation." The symbols should be quoted: `never', `always', etc. Btw, perhaps it's better to use nil instead of 'never'. > +(defun dired--create-dirs (dir) > + (unless (file-exists-p dir) > + (pcase dired-create-destination-dirs > + ('never nil) > + ('always (dired-create-directory dir)) > + ('prompt > + (when (yes-or-no-p (format "Create destination dir '%s'? " dir)) > + (dired-create-directory dir)))))) Is use of pcase really justified here? > +(ert-deftest dired-test-bug28834 () > + "test for https://debbugs.gnu.org/28834 ." > + (let* ((from (make-temp-file "from")) > + (foo (make-temp-file "foo" 'dir)) > + (bar (file-name-as-directory (expand-file-name "bar" foo))) > + (qux (file-name-as-directory (expand-file-name "qux" foo))) > + (tmpdir temporary-file-directory) > + (to-cp (expand-file-name "foo-cp" bar)) > + (to-mv (expand-file-name "foo-mv" qux)) > + (dired-create-destination-dirs 'always)) > + (unwind-protect > + (progn > + (dired-copy-file-recursive from to-cp nil) > + (should (file-exists-p to-cp)) > + (dired-rename-file from to-mv nil) > + (should (file-exists-p to-mv)) > + ;; Repeat the same with `dired-create-destination-dirs' set to 'never. > + (dired-rename-file to-mv from nil) > + (delete-file to-cp) > + (delete-directory bar) > + (delete-directory qux) > + (let ((dired-create-destination-dirs 'never)) > + (should-error (dired-copy-file-recursive from to-cp nil)) > + (should-error (dired-rename-file from to-mv nil)))) This doesn't test the 3rd value. Why is that? From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 21:49:30 2017 Received: (at 28834) by debbugs.gnu.org; 17 Oct 2017 01:49:31 +0000 Received: from localhost ([127.0.0.1]:44530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4H0c-000882-OC for submit@debbugs.gnu.org; Mon, 16 Oct 2017 21:49:30 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:41740) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4H0a-00087p-M9 for 28834@debbugs.gnu.org; Mon, 16 Oct 2017 21:49:29 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v9H1nMu2002271 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Oct 2017 01:49:22 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v9H1nJuM024118 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Oct 2017 01:49:21 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v9H1nI8r026744; Tue, 17 Oct 2017 01:49:18 GMT MIME-Version: 1.0 Message-ID: <664a4f33-63e2-44c0-9fab-b41b383aee98@default> Date: Mon, 16 Oct 2017 18:49:17 -0700 (PDT) From: Drew Adams To: Tino Calancha Subject: RE: bug#28834: 25.1; dired-do-copy: allow to copy into a nonexistent directory References: <006201d344da$d9316a50$8b943ef0$@gmail.com> <87shel2f93.fsf@gmail.com> <329916c9-5a00-4460-83db-f16b98e79edb@default> <87mv4r3gat.fsf@gmail.com> In-Reply-To: <87mv4r3gat.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4600.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 28834 Cc: Eli Zaretskii , 28834@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Thanks for working on this, Tino. I haven't looked at it in detail. 1. Maybe name the function `dired-maybe-create-dirs' (and I don't see why its name should suggest that it is internal). 2. I think this should use `%s', no? (format "Create destination dir '%s'? " dir)) (I'm also surprised that we apparently now use '...' instead of `...' in News, but whatever...) From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 00:49:50 2017 Received: (at 28834) by debbugs.gnu.org; 17 Oct 2017 04:49:50 +0000 Received: from localhost ([127.0.0.1]:44611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4Jp7-0003ru-Og for submit@debbugs.gnu.org; Tue, 17 Oct 2017 00:49:50 -0400 Received: from mail-pg0-f54.google.com ([74.125.83.54]:57172) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4Jp6-0003rg-AB for 28834@debbugs.gnu.org; Tue, 17 Oct 2017 00:49:48 -0400 Received: by mail-pg0-f54.google.com with SMTP id m18so483879pgd.13 for <28834@debbugs.gnu.org>; Mon, 16 Oct 2017 21:49:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=EhM1ag+17Je0ze3YEHOOik0tegeTrFwH0V7XZ9tmLdk=; b=B48Y0E6RkCqYRHgAO8bw7JSX2qIEBDZt5TH2qe2JxGpAsLJ24y5AFwvVOviuNAFw/S VzSztK4RKRnB4POaI57y8+SbCNr0Z9ZgBqjqlTpE4sP6yhSykPF9rZu8VIJZBYNxoMYT HfSMlVtqq1nDrYTxE8A2uYoKUHiPB4GttD/Ig9ItgBsRw8MiYF9J7aldCfqOHlXMYcpg VHusCH5IAVVBsEiWZg7cMrKZW0XWIRfC+J3PmNEJOer1KHpf3OZP0eS2CORVwxAB/rJm 9BoNf+3UQckt2Abw+dObtRcBaH/hlKKyJYpeaIIIXjjQGtjrUGDivv8cRIyj6+LFUwxx d+HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=EhM1ag+17Je0ze3YEHOOik0tegeTrFwH0V7XZ9tmLdk=; b=cHmMvKj4nP03K3Oo/3y9pMzIlRhlE/LQJ5Td1XVqCr3equluEi5wxHKfFYKGplzunB arvki1R0n9o2Wz72QoklPikXMSmYgCSiBL/21OfGQJsawAzwq8vBodqa4qSvzt9cIrk/ die0T5RH6IhedYSh4gKCUfesyKCL26zyxgdUuYv7krISCzd6/2XLe3DXKP5XDKaV1sey uETKC87lceV/Bc/GOsDfiBnv1YsTitYzENsmc/eix6BGUh1wrwNGBpaIbBZPT06jRchT U2rDpLOGjDomutxbyP0XS1fOVA4BTfVN0Bbnak4rSjWryVE3FciY3wU8+xQamKYTmg44 BYew== X-Gm-Message-State: AMCzsaWz0yAGoTwEFwrUGrJljG3yXVu3ZUYAzHxU6af5Mav9RZT+HkRd vfcVPeqsTgTkbs+LeReRI/s= X-Google-Smtp-Source: AOwi7QBXikNy7LFdMm5AFsNHn1Ld5jeQSHHobdhobarreCfTaOvL/Z+IP531mDrj5pUoAW5SHtiT8g== X-Received: by 10.98.163.196 with SMTP id q65mr10556816pfl.7.1508215782116; Mon, 16 Oct 2017 21:49:42 -0700 (PDT) Received: from calancha-pc (203.191.218.133.dy.bbexcite.jp. [133.218.191.203]) by smtp.gmail.com with ESMTPSA id m195sm17442292pga.13.2017.10.16.21.49.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2017 21:49:41 -0700 (PDT) From: Tino Calancha To: Eli Zaretskii Subject: Re: bug#28834: 25.1; dired-do-copy: allow to copy into a nonexistent directory In-Reply-To: <83o9p7f4wz.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 16 Oct 2017 19:12:12 +0300") References: <006201d344da$d9316a50$8b943ef0$@gmail.com> <87shel2f93.fsf@gmail.com> <329916c9-5a00-4460-83db-f16b98e79edb@default> <87mv4r3gat.fsf@gmail.com> <83o9p7f4wz.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Date: Tue, 17 Oct 2017 13:49:34 +0900 Message-ID: <87376i2xb5.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 28834 Cc: 28834@debbugs.gnu.org, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Eli Zaretskii writes: Thank you for the comments. * I have changed the new function name to `dired-maybe-create-dirs' as Drew suggested. * I think I have addressed all your comments as well. >> +The option @var{dired-create-destination-dirs} controls whether Dired >> +should create non-existent directories in @var{new}. > > This sentence is redundant (repeated right after it), and also uses > @var incorrectly. Removed that entence. >> +@videnx dired-create-destination-dirs > ^^^^^^^ > A typo. Fixed. >> +means Dired automatically creates them; the value @code{prompt} >> +means Dired asks you for confirmation before creating them. > > I think we generally use 'ask', not 'prompt' in these cases. Changed to 'ask. >> +** Dired >> + >> +--- > > Since you've updated the manual, this should be "+++", not "---". OK. >> +'dired-do-copy' and 'dired-rename-file' must create non-existent > ^^^^ > "Should", not "must". OK. >> +If never, don't create them. >> +If always, create them without ask. >> +If prompt, ask for user confirmation." > > The symbols should be quoted: `never', `always', etc. OK. > Btw, perhaps it's better to use nil instead of 'never'. Changed never ---> nil. >> +(defun dired--create-dirs (dir) >> + (unless (file-exists-p dir) >> + (pcase dired-create-destination-dirs >> + ('never nil) >> + ('always (dired-create-directory dir)) >> + ('prompt >> + (when (yes-or-no-p (format "Create destination dir '%s'? " dir)) >> + (dired-create-directory dir)))))) > > Is use of pcase really justified here? I rewrote the function: now it loooks more simple. >> +(ert-deftest dired-test-bug28834 () >> + "test for https://debbugs.gnu.org/28834 ." > This doesn't test the 3rd value. Why is that? Laziness? Bad memory? Busy? Stomach problems? Other not listed here? Updated the test: now it run all cases. --8<-----------------------------cut here---------------start------------->8--- commit fb91d159f241a6eeecc41c4101472f145a00c0d1 Author: Tino Calancha Date: Tue Oct 17 13:48:59 2017 +0900 Allow to copy/rename file into a non-existent dir * lisp/dired-aux.el (dired-create-destination-dirs): New option. (dired-maybe-create-dirs): New defun. (dired-copy-file-recursive, dired-rename-file): Use it (Bug#28834). * lisp/dired-aux-tests.el (dired-test-bug28834): Add test. * doc/emacs/dired.texi (Operating on Files): Update manual. * etc/NEWS (Changes in Specialized Modes and Packages in Emacs 27.1) Announce this change. diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index db5dea329b..9348ef5042 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -647,6 +647,14 @@ Operating on Files is the directory to copy into, or (if copying a single file) the new name. This is like the shell command @code{cp}. +@vindex dired-create-destination-dirs +The option @code{dired-create-destination-dirs} controls whether Dired +should create non-existent directories in the destination while +copying/renaming files. The default value @code{nil} means Dired +never creates such missing directories; the value @code{always}, +means Dired automatically creates them; the value @code{ask} +means Dired asks you for confirmation before creating them. + @vindex dired-copy-preserve-time If @code{dired-copy-preserve-time} is non-@code{nil}, then copying with this command preserves the modification time of the old file in @@ -678,6 +686,9 @@ Operating on Files you rename several files, the argument @var{new} is the directory into which to move the files (this is like the shell command @command{mv}). +The option @code{dired-create-destination-dirs} controls whether Dired +should create non-existent directories in @var{new}. + Dired automatically changes the visited file name of buffers associated with renamed files so that they refer to the new names. diff --git a/etc/NEWS b/etc/NEWS index 716b0309a5..acfc52ab52 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -56,6 +56,13 @@ whether '"' is also replaced in 'electric-quote-mode'. If non-nil, * Changes in Specialized Modes and Packages in Emacs 27.1 +** Dired + ++++ +*** The new user option 'dired-create-destination-dirs' controls whether +'dired-do-copy' and 'dired-rename-file' should create non-existent +directories in the destination. + ** Edebug +++ diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 7e2252fcf1..5e92c58d12 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1548,6 +1548,24 @@ dired-copy-file (declare-function make-symbolic-link "fileio.c") +(defcustom dired-create-destination-dirs nil + "Whether Dired should create destination dirs when copying/removing files. +If nil, don't create them. +If `always', create them without ask. +If `ask', ask for user confirmation." + :type '(choice (const :tag "Never create non-existent dirs" nil) + (const :tag "Always create non-existent dirs" always) + (const :tag "Ask for user confirmation" ask)) + :group 'dired + :version "27.1") + +(defun dired-maybe-create-dirs (dir) + "Create DIR if doesn't exist according with `dired-create-destination-dirs'." + (when (and dired-create-destination-dirs (not (file-exists-p dir))) + (if (or (eq dired-create-destination-dirs 'always) + (yes-or-no-p (format "Create destination dir `%s'? " dir))) + (dired-create-directory dir)))) + (defun dired-copy-file-recursive (from to ok-flag &optional preserve-time top recursive) (when (and (eq t (car (file-attributes from))) @@ -1564,6 +1582,7 @@ dired-copy-file-recursive (if (stringp (car attrs)) ;; It is a symlink (make-symbolic-link (car attrs) to ok-flag) + (dired-maybe-create-dirs (file-name-directory to)) (copy-file from to ok-flag preserve-time)) (file-date-error (push (dired-make-relative from) @@ -1573,6 +1592,7 @@ dired-copy-file-recursive ;;;###autoload (defun dired-rename-file (file newname ok-if-already-exists) (dired-handle-overwrite newname) + (dired-maybe-create-dirs (file-name-directory newname)) (rename-file file newname ok-if-already-exists) ; error is caught in -create-files ;; Silently rename the visited file of any buffer visiting this file. (and (get-file-buffer file) diff --git a/test/lisp/dired-aux-tests.el b/test/lisp/dired-aux-tests.el index d41feb1592..9316217dd2 100644 --- a/test/lisp/dired-aux-tests.el +++ b/test/lisp/dired-aux-tests.el @@ -20,7 +20,7 @@ ;;; Code: (require 'ert) (require 'dired-aux) - +(eval-when-compile (require 'cl-lib)) (ert-deftest dired-test-bug27496 () "Test for https://debbugs.gnu.org/27496 ." @@ -40,5 +40,59 @@ (should-not (dired-do-shell-command "ls ? ./`?`" nil files))) (delete-file foo)))) +;; Auxiliar macro for `dired-test-bug28834': it binds +;; `dired-create-destination-dirs' to CREATE-DIRS and execute BODY. +;; If YES-OR-NO is non-nil, it binds `yes-or-no-p' to +;; to avoid the prompt. +(defmacro with-dired-bug28834-test (create-dirs yes-or-no &rest body) + (declare ((debug form symbolp body))) + (let ((foo (make-symbol "foo"))) + `(let* ((,foo (make-temp-file "foo" 'dir)) + (dired-create-destination-dirs ,create-dirs)) + (setq from (make-temp-file "from")) + (setq to-cp + (expand-file-name + "foo-cp" (file-name-as-directory (expand-file-name "bar" ,foo)))) + (setq to-mv + (expand-file-name + "foo-mv" (file-name-as-directory (expand-file-name "qux" ,foo)))) + (unwind-protect + (if ,yes-or-no + (cl-letf (((symbol-function 'yes-or-no-p) + (lambda (prompt) (eq ,yes-or-no 'yes)))) + ,@body) + ,@body) + ;; clean up + (delete-directory ,foo 'recursive) + (delete-file from))))) + +(ert-deftest dired-test-bug28834 () + "test for https://debbugs.gnu.org/28834 ." + (let (from to-cp to-mv) + ;; `dired-create-destination-dirs' set to 'always. + (with-dired-bug28834-test + 'always nil + (dired-copy-file-recursive from to-cp nil) + (should (file-exists-p to-cp)) + (dired-rename-file from to-mv nil) + (should (file-exists-p to-mv))) + ;; `dired-create-destination-dirs' set to nil. + (with-dired-bug28834-test + nil nil + (should-error (dired-copy-file-recursive from to-cp nil)) + (should-error (dired-rename-file from to-mv nil))) + ;; `dired-create-destination-dirs' set to 'ask. + (with-dired-bug28834-test + 'ask 'yes ; Answer `yes' + (dired-copy-file-recursive from to-cp nil) + (should (file-exists-p to-cp)) + (dired-rename-file from to-mv nil) + (should (file-exists-p to-mv))) + (with-dired-bug28834-test + 'ask 'no ; Answer `no' + (should-error (dired-copy-file-recursive from to-cp nil)) + (should-error (dired-rename-file from to-mv nil))))) + + (provide 'dired-aux-tests) ;; dired-aux-tests.el ends here --8<-----------------------------cut here---------------end--------------->8--- In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-10-17 Repository revision: 94281c9a1cc0f756841fdc9b266657853df94a29 From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 12:37:05 2017 Received: (at 28834) by debbugs.gnu.org; 17 Oct 2017 16:37:05 +0000 Received: from localhost ([127.0.0.1]:46522 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4UrY-0006xQ-Qm for submit@debbugs.gnu.org; Tue, 17 Oct 2017 12:37:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52025) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4UrX-0006wx-0r for 28834@debbugs.gnu.org; Tue, 17 Oct 2017 12:37:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4UrO-0002hT-3Y for 28834@debbugs.gnu.org; Tue, 17 Oct 2017 12:36:57 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4UrJ-0002c8-3y; Tue, 17 Oct 2017 12:36:49 -0400 Received: from [176.228.60.248] (port=2880 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e4UrI-0003qm-II; Tue, 17 Oct 2017 12:36:48 -0400 Date: Tue, 17 Oct 2017 19:36:33 +0300 Message-Id: <83376hg29a.fsf@gnu.org> From: Eli Zaretskii To: Tino Calancha In-reply-to: <87376i2xb5.fsf@gmail.com> (message from Tino Calancha on Tue, 17 Oct 2017 13:49:34 +0900) Subject: Re: bug#28834: 25.1; dired-do-copy: allow to copy into a nonexistent directory References: <006201d344da$d9316a50$8b943ef0$@gmail.com> <87shel2f93.fsf@gmail.com> <329916c9-5a00-4460-83db-f16b98e79edb@default> <87mv4r3gat.fsf@gmail.com> <83o9p7f4wz.fsf@gnu.org> <87376i2xb5.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28834 Cc: 28834@debbugs.gnu.org, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Tino Calancha > Cc: 28834@debbugs.gnu.org, drew.adams@oracle.com > Date: Tue, 17 Oct 2017 13:49:34 +0900 > > * I have changed the new function name to `dired-maybe-create-dirs' > as Drew suggested. > * I think I have addressed all your comments as well. Thanks, this LGTM. One minor comment: > +(defun dired-maybe-create-dirs (dir) > + "Create DIR if doesn't exist according with `dired-create-destination-dirs'." ^^^^^^^^^^^^^^ "according to" Please push to master in a few days, if no one raises any issues. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 21 00:13:46 2017 Received: (at 28834-done) by debbugs.gnu.org; 21 Oct 2017 04:13:46 +0000 Received: from localhost ([127.0.0.1]:52968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5lAQ-0007ax-A3 for submit@debbugs.gnu.org; Sat, 21 Oct 2017 00:13:46 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:54028) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5lAO-0007ak-GB for 28834-done@debbugs.gnu.org; Sat, 21 Oct 2017 00:13:44 -0400 Received: by mail-pf0-f170.google.com with SMTP id t188so13466519pfd.10 for <28834-done@debbugs.gnu.org>; Fri, 20 Oct 2017 21:13:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=QJbnKzS1h4i+go1z5GF1mh0xBkKhAhymBJgMl2tTu/c=; b=SH1f3HI0GLTxWhVRzQ1AIIvWYrB/YZD1dtgs+sE6hZ6gGSfxp6vdvJDfew2KcSYVHj m+zAQB6SiiF8DuzeLfGmW0bHYT/5pq+vdoeYrtiQ1kRd8MJr8yc3/Ek6eWbIdV9wFqor Z0sOesjhXCtJDRImbVLe74mDk+o4UYnra89M44erTH5+BzDK/rQr7U/9/HdvdCg23da4 YlHOfDURNpLEwmAvxx88a2MvzP+Z8Czhdpd8lkEdwz0xbAg1Ock1G17PPHCj7SVTxTNq Dby5VBX3kHbuUHQJNAT+8ufCf3rGk69sblVv+REtOxJkd9Ioy8UUTI5uDGPobHFLy4FB ARcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=QJbnKzS1h4i+go1z5GF1mh0xBkKhAhymBJgMl2tTu/c=; b=c39z4ef5Pk0da3DIu5mj9kF+M0MeJ3h3q8ZOFErchddWt9IilRtF/NyjIkq4Fl4Tw6 OQQBdNdgt5ZV1YaP+ZuJypeOA3DFmYK48P8jRKRXVrYP6xwEq7NDY0Cyk/Cg6uO/o93o jXosFAKNSq9OjtQk+jNVAbyfm3/NPG0ZIqOf8o7qQhQKzYqHvEwftiUJuzONzuDVhRCC IFZScqnlI31MEye/XS2dmwCEGNlqjQL4D9pPdUjG7TuvdjzWIJvxz4GtTcGObi9L07La /PITBvK4wYWZ8LfHdTSEhUBsit75I3h/VjOruz/EUG4u6XEvzF5bDucbhgoBQqhCCeey z5wQ== X-Gm-Message-State: AMCzsaUsla8D2syAzZpJ8TfE1bQJCONc2aWMmrlMjNtDh5CTIDk4r1ju vo893FNWOtFPGujGfw11mBi/4A== X-Google-Smtp-Source: ABhQp+SYFOySvLlQKZCzS96m8Hav59big8dvrCFIstDXJ/9c9J/scDl7ahe6dn9pImNdh6x/ggFOOQ== X-Received: by 10.159.218.9 with SMTP id v9mr5470861plp.92.1508559218063; Fri, 20 Oct 2017 21:13:38 -0700 (PDT) Received: from calancha-pc (203.191.218.133.dy.bbexcite.jp. [133.218.191.203]) by smtp.gmail.com with ESMTPSA id h1sm3745279pfg.143.2017.10.20.21.13.36 for <28834-done@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2017 21:13:37 -0700 (PDT) From: Tino Calancha To: 28834-done@debbugs.gnu.org Subject: Re: bug#28834: 25.1; dired-do-copy: allow to copy into a nonexistent directory References: <006201d344da$d9316a50$8b943ef0$@gmail.com> <87shel2f93.fsf@gmail.com> <329916c9-5a00-4460-83db-f16b98e79edb@default> <87mv4r3gat.fsf@gmail.com> <83o9p7f4wz.fsf@gnu.org> <87376i2xb5.fsf@gmail.com> <83376hg29a.fsf@gnu.org> Date: Sat, 21 Oct 2017 13:13:34 +0900 In-Reply-To: <83376hg29a.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 17 Oct 2017 19:36:33 +0300") Message-ID: <878tg55ea9.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 28834-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Eli Zaretskii writes: >> From: Tino Calancha >> Cc: 28834@debbugs.gnu.org, drew.adams@oracle.com >> Date: Tue, 17 Oct 2017 13:49:34 +0900 >> >> * I have changed the new function name to `dired-maybe-create-dirs' >> as Drew suggested. >> * I think I have addressed all your comments as well. > > Thanks, this LGTM. Added feature into master branch as commit "Allow to copy/rename file into a non-existent dir" (cb29f41624e5163a0aea4bfc98591e683807a2f8) From unknown Mon Jun 23 04:10:37 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 18 Nov 2017 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator