[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Creating a directory target for dired-do-copy
From: |
Luis O. Silva |
Subject: |
Re: Creating a directory target for dired-do-copy |
Date: |
Sun, 30 Jan 2005 12:17:25 -0600 |
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 activate)
KR> "Create non-existent directories for the result, as necessary.
KR> If the returned file name is a directory name (e.g. ends in slash 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-return-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>".
--
Luis Octavio Silva Pereyra.
IIMAS-UNAM
Depto. de Métodos Matemáticos y Numéricos
Apdo. postal 20-726
01000 México, D.F.