From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Creating a directory target for dired-do-copy Date: Wed, 02 Feb 2005 09:30:46 -0700 Message-ID: <36cdhoF4ve97gU1@individual.net> References: <35v2tbF4ok485U1@individual.net> <16893.9397.851618.136556@mmyn404.iimas.unam.mx> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1107361991 15242 80.91.229.2 (2 Feb 2005 16:33:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 2 Feb 2005 16:33:11 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 02 17:33:11 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1CwNPu-0003Xy-Qk for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Feb 2005 17:31:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CwNd0-00014K-DU for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Feb 2005 11:45:18 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 44 Original-X-Trace: individual.net CQwlVCqXlv8Xe5EzfQUWLAOf0/zpBh1pRhaH7wOOQS4zGw3a4= User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: Original-Xref: shelby.stanford.edu gnu.emacs.help:128354 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org X-MailScanner-To: geh-help-gnu-emacs@m.gmane.org Xref: main.gmane.org gmane.emacs.help:23865 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23865 Luis O. Silva wrote: > On Sun, 30 Jan 2005 12:17:25 -0600, "Luis O. Silva" said: > > LS> I'm very grateful for your help, unfortunately it > LS> doesn't work for me. I put the previous snippet in my > LS> .emacs file and, after reloading, I typed `C' within > LS> dired. Then in the minibuffer I typed after Copy [-p] > LS> file-test to: > > LS> ~/temporary/non-existing-file/ > > Sorry for answering my own post, but it was written > incorrectly. > > LS> where non-existing-file is a non-existing file. > > Here I mean non-existing directory. Right, I'd guessed that. > LS> Emacs says > > LS> File exists: /home/silva/temporary/non-existing-file/ > > LS> Actually after loading the snippet, Emacs says the > LS> same even for an existing directory! > > LS> I tried to correct the code, but it seems that I > LS> don't understand it. Any hint will be enormously > LS> appreciated. It turns out the code tries to be too smart and do too much. Just delete the second form in the advice (and the second sentence of its doc string), leaving: (defadvice dired-mark-read-file-name (after make-directory activate) "Create non-existent directories for the result, as necessary." (let ((directory (file-name-directory ad-return-value))) (unless (file-directory-p directory) (make-directory directory t)))) -- Kevin Rodgers