From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Luis O. Silva" Newsgroups: gmane.emacs.help Subject: Re: Creating a directory target for dired-do-copy Date: Sun, 30 Jan 2005 12:17:25 -0600 Message-ID: <16893.9397.851618.136556@mmyn404.iimas.unam.mx> References: <35v2tbF4ok485U1@individual.net> Reply-To: "Luis O. Silva" NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1107105329 27081 80.91.229.6 (30 Jan 2005 17:15:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 30 Jan 2005 17:15:29 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 30 18:15:17 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 1CvIfN-0006dL-00 for ; Sun, 30 Jan 2005 18:15:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CvIs4-00040R-HV for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Jan 2005 12:28:24 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CvIqy-0003ZJ-LT for help-gnu-emacs@gnu.org; Sun, 30 Jan 2005 12:27:16 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CvIqo-0003Ud-QS for help-gnu-emacs@gnu.org; Sun, 30 Jan 2005 12:27:08 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CvIqo-0003Tv-JL for help-gnu-emacs@gnu.org; Sun, 30 Jan 2005 12:27:06 -0500 Original-Received: from [194.67.23.121] (helo=mx1.mail.ru) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CvIYh-0003mX-N9 for help-gnu-emacs@gnu.org; Sun, 30 Jan 2005 12:08:23 -0500 Original-Received: from [132.248.51.45] (port=1029 helo=mmyn404.iimas.unam.mx) by mx1.mail.ru with esmtp id 1CvIYf-000G7B-00 for help-gnu-emacs@gnu.org; Sun, 30 Jan 2005 20:08:22 +0300 Original-To: help-gnu-emacs@gnu.org Original-Newsgroups: gnu.emacs.help In-Reply-To: <35v2tbF4ok485U1@individual.net> X-Mailer: VM 7.03 under Emacs 21.2.1 X-Spam: Not detected 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:23756 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23756 Thank you for your message (Fri, 28 Jan 2005 08:09:26 -0700), in which, among other things, you wrote[1]: KR> Could it be as simple as; KR> (defadvice dired-mark-read-file-name (after make-directory activ= ate) KR> "Create non-existent directories for the result, as necessary= . KR> If the returned file name is a directory name (e.g. ends in slas= h on Unix), KR> create it." KR> (let ((directory (file-name-directory ad-return-value))) KR> (unless (file-directory-p directory) KR> (make-directory directory t))) KR> (when (equal (file-name-as-directory ad-return-value) ad-ret= urn-value) KR> (make-directory ad-return-value))) I'm very grateful for your help, unfortunately it doesn't work for me. I put the previous snippet in my .emacs file and, after reloading, I typed `C' within dired. Then in the minibuffer I typed after Copy [-p] file-test to: ~/temporary/non-existing-file/ where non-existing-file is a non-existing file. Emacs says File exists: /home/silva/temporary/non-existing-file/ Actually after loading the snippet, Emacs says the same even for an existing directory! I tried to correct the code, but it seems that I don't understand it. Any hint will be enormously appreciated. Best regards, luis Footnotes: [1] The excerpts of your message are prefixed by "KR>". --=20 Luis Octavio Silva Pereyra. IIMAS-UNAM Depto. de M=E9todos Matem=E1ticos y Num=E9ricos Apdo. postal 20-726 01000 M=E9xico, D.F.