From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: PR: dired-do-create-files now checks for trailing slashes in the target Date: Wed, 29 Sep 2021 06:46:04 +0200 Message-ID: <874ka43rp1.fsf@gnu.org> References: <831r58k0cx.fsf@gnu.org> <87tui4qyni.fsf@gnu.org> <83tui4iift.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20492"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.7.0; emacs 28.0.50 Cc: rudiwillalwaysloveyou@gmail.com, stefankangas@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Sep 29 06:57:47 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mVRf8-0005AQ-WA for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Sep 2021 06:57:46 +0200 Original-Received: from localhost ([::1]:55868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVRf8-0008Mo-0i for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Sep 2021 00:57:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVReQ-0007cX-H1 for emacs-devel@gnu.org; Wed, 29 Sep 2021 00:57:02 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43658) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVReO-0002Tv-VL; Wed, 29 Sep 2021 00:57:02 -0400 Original-Received: from auth1-smtp.messagingengine.com ([66.111.4.227]:54719) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVReB-0005WH-2v; Wed, 29 Sep 2021 00:57:00 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 916A627C0054; Wed, 29 Sep 2021 00:56:45 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 29 Sep 2021 00:56:45 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekuddgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvufffjgfkgggtsehttdertddtredtnecuhfhrohhmpefvrghsshhi lhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqnecuggftrfgrthhtvghrnhepve evieekteekveeigfefffeivdetgeduvdffueeuudevgedttdehvdfhueevfffhnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomh gvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdel kedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 29 Sep 2021 00:56:44 -0400 (EDT) In-reply-to: <83tui4iift.fsf@gnu.org> X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:275758 Archived-At: Eli Zaretskii writes: Hi Eli, >> It solves the problem of moving/copying a file or directory into a >> not-yet-existing directory. So with the above example, you can do >> >> R /new_name/ RET > > So the behavior will now differ depending on whether new_name already > exists or not? Right. And also `dired-create-destination-dirs' has to be non-nil for the new behavior which conforms to its documentation. I have that set to 'ask, and when I apply Rudi's patch and do the recipe, it'll ask if a new directory new_name/ should be created. > because if the user types > > R /new_ TAB > > Emacs will complete it to "/new_name/", including the trailing slash. But only if it exists, and then the patch makes no difference in behavior. You explicitly need to type non_existing_dir/ with trailing slash for the new behavior which will surely never be completed because of its non-existence. FWIW, I've applied the patch locally and like it very much. Of course, if we agree on including it, it will need to be documented somewhere. I'm not sure where the best place is. It's concerned with possibly creating a new target directory which happens not only with our renaming/moving example but also with copying, symlinking, etc. Maybe a good spot would be the docstring/texinfo docs for `dired-create-destination-dirs'. It basically needs another sentence that when specifying a target of a dired operation, one can add a trailing / to inform dired that the target is a directory which should be created if non-existent. Bye, Tassilo