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: Thu, 30 Sep 2021 16:10:02 +0200 Message-ID: <87lf3ew3k5.fsf@gnu.org> References: <831r58k0cx.fsf@gnu.org> <87tui4qyni.fsf@gnu.org> <83tui4iift.fsf@gnu.org> <874ka43rp1.fsf@gnu.org> <83ee97il43.fsf@gnu.org> <87zgrv33mf.fsf@gnu.org> <838rzfijnj.fsf@gnu.org> <87r1d73312.fsf@gnu.org> <837deziiwz.fsf@gnu.org> <87ee97bgxt.fsf@gnus.org> <87fstn2ydc.fsf@gnu.org> <87bl4a7g2m.fsf@gnus.org> <87sfxmqwdr.fsf@gnu.org> <87bl4a2nng.fsf@gnus.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="2611"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.7.0; emacs 28.0.50 Cc: Eli Zaretskii , emacs-devel@gnu.org, rudiwillalwaysloveyou@gmail.com, Stefan Kangas To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 30 16:18:44 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 1mVwtY-0000Tx-Eg for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Sep 2021 16:18:44 +0200 Original-Received: from localhost ([::1]:46928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVwtW-0004no-VS for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Sep 2021 10:18:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVwsP-0003Sj-W2 for emacs-devel@gnu.org; Thu, 30 Sep 2021 10:17:34 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48010) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVwsP-0000SF-Jd; Thu, 30 Sep 2021 10:17:33 -0400 Original-Received: from auth1-smtp.messagingengine.com ([66.111.4.227]:54311) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVwsP-0006sW-DZ; Thu, 30 Sep 2021 10:17:33 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 1740427C0054; Thu, 30 Sep 2021 10:17:33 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 30 Sep 2021 10:17:33 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekgedgjedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvufffjgfkgggtsehttdertddtredtnecuhfhrohhmpefvrghsshhi lhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqnecuggftrfgrthhtvghrnhepve evieekteekveeigfefffeivdetgeduvdffueeuudevgedttdehvdfhueevfffhnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomh gvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdel kedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Sep 2021 10:17:31 -0400 (EDT) In-reply-to: <87bl4a2nng.fsf@gnus.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:275902 Archived-At: Lars Ingebrigtsen writes: > Tassilo Horn writes: > >> With Rudi's patch, it's exactly the same when the destination is >> foo/bar. But if you specify foo/bar/ as destination, dired will create >> foo/bar/ (maybe after asking as controlled by >> `dired-create-destination-dirs') and you get foo/bar/file.txt. > > That does seem quite intuitive and attractive (and is somewhat > analogous to what Emacs does with `C-x C-w' today). Right. > OK, you've convinced me. Adding a user option like > `dired-create-destination-dirs' (as Eli said) is probably the best, > though. `dired-create-destination-dirs' already exists. But in Rudi's most recent patch version, he added a new one. --8<---------------cut here---------------start------------->8--- +(defcustom dired-create-destination-dirs-trailing-separator-special nil + "If t, when selecting a single destination in Dired, paths that end in a path separator will be treated as a non-existent directory, and acted on according to `dired-create-destination-dirs'. + +This option is only relevant if `dired-create-destination-dirs' is not `nil', and you are moving/copying a single directory. + +For example, when renaming a directory named `old_name' to `new_name/' (note the trailing path separator), `new_name' might be created depending on `dired-create-destination-dirs' and `old_name' will be moved into it if it is created; Otherwise `old_name' will be directly renamed to `new_name'." + :type '(choice (const :tag "Do not treat paths with a trailing path separator specially" nil) + (const :tag "Treat paths with a trailing path separator specially" t)) + :group 'dired + :version "28.1") --8<---------------cut here---------------end--------------->8--- I still think that this is not really necessary but won't object. Rudi proposed that the default value should probably be `t' given that this feels so intuitive and the only gotcha is renaming/moving or copying a directory source/ to a non-existent target or target/ where the former has rename/make a copy semantics and the latter has move/copy *into* the to be created target/ directory. Bye, Tassilo