+2007-11-17 Juri Linkov <juri@jurta.org>
+
+ * dired-aux.el (dired-create-directory): Allow creating
+ a directory of an arbitrary depth. Add a loop to find the topmost
+ nonexistent parent dir `new', and call `dired-add-file' on it.
+ Set the `PARENTS' arg of `make-directory' to t.
+
2007-11-16 Jay Belanger <jay.p.belanger@gmail.com>
* calc/calc-aent.el (calc-last-user-lang-parse-table): New variable.
"Create a directory called DIRECTORY."
(interactive
(list (read-file-name "Create directory: " (dired-current-directory))))
- (let ((expanded (directory-file-name (expand-file-name directory))))
- (make-directory expanded)
- (dired-add-file expanded)
- (dired-move-to-filename)))
+ (let* ((expanded (directory-file-name (expand-file-name directory)))
+ (try expanded) new)
+ ;; Find the topmost nonexistent parent dir (variable `new')
+ (while (and try (not (file-exists-p try)) (not (equal new try)))
+ (setq new try
+ try (directory-file-name (file-name-directory try))))
+ (make-directory expanded t)
+ (when new
+ (dired-add-file new)
+ (dired-move-to-filename))))
(defun dired-into-dir-with-symlinks (target)
(and (file-directory-p target)