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: Fri, 28 Jan 2005 08:09:26 -0700 Message-ID: <35v2tbF4ok485U1@individual.net> References: NNTP-Posting-Host: deer.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 1106925309 21374 80.91.229.6 (28 Jan 2005 15:15:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 28 Jan 2005 15:15:09 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 28 16:15:01 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CuXpt-0003ct-00 for ; Fri, 28 Jan 2005 16:15:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CuY2J-0003yD-6o for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Jan 2005 10:27:51 -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: 22 Original-X-Trace: individual.net D8FEa+GMHvS7qDkVpr2VVwsAvkOGq3VXFkT55r+fFsDB7VxC4= 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:128222 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 Xref: main.gmane.org gmane.emacs.help:23724 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23724 Luis O. Silva wrote: > Let us suppose that you are in dired mode without any marked > files and you type `C', that is (`dired-do-copy'). You're > asked for the directory to copy into or the new file > name. What do you have to do if you want to copy the file to a > nonexistent directory? Is there an easy way to create the > target directory without doing this separately? Could it be as simple as; (defadvice dired-mark-read-file-name (after make-directory activate) "Create non-existent directories for the result, as necessary. If the returned file name is a directory name (e.g. ends in slash on Unix), create it." (let ((directory (file-name-directory ad-return-value))) (unless (file-directory-p directory) (make-directory directory t))) (when (equal (file-name-as-directory ad-return-value) ad-return-value) (make-directory ad-return-value))) -- Kevin Rodgers