From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mathieu Basille Newsgroups: gmane.emacs.bugs Subject: bug#25609: 25.1; Dired: Copy folder with 'dired-dwim-target t' results in nested copy Date: Sat, 4 Feb 2017 13:13:24 -0500 Message-ID: References: <4cee1f04-3644-ba9f-1542-d29108cd2472@basille.net> <87mve2qi86.fsf@calancha-pc> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1486232051 18627 195.159.176.226 (4 Feb 2017 18:14:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 4 Feb 2017 18:14:11 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 Cc: 25609@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 04 19:14:07 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ca4qd-0004bv-7G for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Feb 2017 19:14:07 +0100 Original-Received: from localhost ([::1]:40486 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ca4qi-0001Y3-NH for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Feb 2017 13:14:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ca4qb-0001XU-O1 for bug-gnu-emacs@gnu.org; Sat, 04 Feb 2017 13:14:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ca4qY-0003Es-IF for bug-gnu-emacs@gnu.org; Sat, 04 Feb 2017 13:14:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58075) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ca4qY-0003Ed-EI for bug-gnu-emacs@gnu.org; Sat, 04 Feb 2017 13:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ca4qY-0004HZ-1f for bug-gnu-emacs@gnu.org; Sat, 04 Feb 2017 13:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mathieu Basille Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Feb 2017 18:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25609 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25609-submit@debbugs.gnu.org id=B25609.148623201716421 (code B ref 25609); Sat, 04 Feb 2017 18:14:02 +0000 Original-Received: (at 25609) by debbugs.gnu.org; 4 Feb 2017 18:13:37 +0000 Original-Received: from localhost ([127.0.0.1]:56274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ca4q7-0004Gm-FF for submit@debbugs.gnu.org; Sat, 04 Feb 2017 13:13:36 -0500 Original-Received: from sender-of-o51.zoho.com ([135.84.80.216]:21144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ca4q5-0004Gd-NM for 25609@debbugs.gnu.org; Sat, 04 Feb 2017 13:13:34 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zoho; d=basille.net; h=subject:to:cc:references:from:message-id:date:user-agent:mime-version:in-reply-to:content-type; b=FsPvWnm9SaGLHNXPBu2MzlYWCeZOCHycQNlRlNKtszKMqV3QclTLO9rr60fKte/kEnDY8gHmZByA arDYqrD27CiI4wHlcw/+nf5tjejx/z3ipYx942tKkjzDfDfcVdvLZgOd2rhA2cIbu4yLTiiuV4lk rX+vWydgFZCROehHsME= Original-Received: from [10.228.3.42] (host-128-227-195-37.xlate.ufl.edu [128.227.195.37]) by mx.zohomail.com with SMTPS id 1486232005265513.4570021065134; Sat, 4 Feb 2017 10:13:25 -0800 (PST) In-Reply-To: <87mve2qi86.fsf@calancha-pc> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:128959 Archived-At: Thanks for looking it up! Do you know when/if this patch will be available? Mathieu. On 02/04/2017 06:59 AM, Tino Calancha wrote: > Mathieu Basille writes: > >> Dear Emacs maintainers, >> >> The behavior I have is odd at best, but the situation is simple: given a >> folder 'test', I want to make a copy of it in another folder. >> >> In practice (keyboard commands are between <>): >> >> * Open Emacs, in any folder. >> * <+ test> to create a folder 'test'. >> * <+ target> to create a folder 'target'. >> * Move on 'test' then to copy it in 'target', to copy >> recursively. >> >> So far so good, the empty 'test' folder is copied as expected. Assuming >> there is some change in this folder, we want to copy it again to the >> same place: >> >> * Move on 'test' then to copy it in 'target'. >> * Dired asks for confirmation to overwrite it, and if yes copies it >> again. >> >> Now the weird behavior. With '(setq dired-dwim-target t)': >> >> * Open a second window . >> * Move to 'target' in this window, as to have 'target' on the right >> window, but the initial folder on the left window. >> * In the left window, move on 'test' and to copy it again, DWIM will >> suggest directly 'target/', so all that is needed is . >> >> Note that there is no question to overwrite it or not. Visiting 'target' >> now shows the 'test' folder, but inside it a second copy of 'test'! >> >> Even weirder: >> >> * Create an empty file in the original folder (, then > C-s> to save it, and to kill it). >> * Select in the left window both 'test' and 'bla' with . >> * to copy them, DWIM will suggest directly 'target/', so all that is >> needed is . >> >> Now it asks for confirmation to overwrite and copies 'test' together >> with 'bla' in 'target' as expected! > Same behaviour in Emacs-24 and master branch. > Following patch works to me: > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > From 796a13469ac9f0084416a8b0bc0b3355b67e9d12 Mon Sep 17 00:00:00 2001 > From: Tino Calancha > Date: Sat, 4 Feb 2017 20:59:06 +0900 > Subject: [PATCH] Fix Bug#25609 > > * lisp/dired-aux.el (dired-do-create-files): > If 'dired-dwim-target is non-nil, then bind 'default' to nil. > --- > lisp/dired-aux.el | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el > index caa3b45705..bc44f036e5 100644 > --- a/lisp/dired-aux.el > +++ b/lisp/dired-aux.el > @@ -1791,6 +1791,7 @@ dired-do-create-files > (and (consp fn-list) (null (cdr fn-list)) (car fn-list))) > (target-dir (dired-dwim-target-directory)) > (default (and dired-one-file > + (not dired-dwim-target) > (expand-file-name (file-name-nondirectory (car fn-list)) > target-dir))) > (defaults (dired-dwim-target-defaults fn-list target-dir)) >