all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Creating a directory target for dired-do-copy
Date: Fri, 28 Jan 2005 08:09:26 -0700	[thread overview]
Message-ID: <35v2tbF4ok485U1@individual.net> (raw)
In-Reply-To: <mailman.14988.1106600827.27204.help-gnu-emacs@gnu.org>

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

       reply	other threads:[~2005-01-28 15:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.14988.1106600827.27204.help-gnu-emacs@gnu.org>
2005-01-28 15:09 ` Kevin Rodgers [this message]
2005-01-30 18:17   ` Creating a directory target for dired-do-copy Luis O. Silva
2005-01-31 17:07     ` Luis O. Silva
     [not found]     ` <mailman.178.1107188275.2841.help-gnu-emacs@gnu.org>
2005-02-02 16:30       ` Kevin Rodgers
2005-02-03 22:06         ` Luis O. Silva
2005-01-24 21:32 Luis O. Silva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=35v2tbF4ok485U1@individual.net \
    --to=ihs_4664@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.