diff options
| author | Juri Linkov | 2007-11-17 01:27:52 +0000 |
|---|---|---|
| committer | Juri Linkov | 2007-11-17 01:27:52 +0000 |
| commit | 934b49686de4d606e69fb6a2acbffdf3a7e62997 (patch) | |
| tree | f1a22d9807eb847291f262ef8cee3a8f77c1033e | |
| parent | b2e7f0f07fac4aa5d18b38cf73ff0e59198302f2 (diff) | |
| download | emacs-934b49686de4d606e69fb6a2acbffdf3a7e62997.tar.gz emacs-934b49686de4d606e69fb6a2acbffdf3a7e62997.zip | |
(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.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/dired-aux.el | 14 |
2 files changed, 17 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0cfe7fe704d..d0fb5ef28da 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2007-11-17 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * dired-aux.el (dired-create-directory): Allow creating | ||
| 4 | a directory of an arbitrary depth. Add a loop to find the topmost | ||
| 5 | nonexistent parent dir `new', and call `dired-add-file' on it. | ||
| 6 | Set the `PARENTS' arg of `make-directory' to t. | ||
| 7 | |||
| 1 | 2007-11-16 Jay Belanger <jay.p.belanger@gmail.com> | 8 | 2007-11-16 Jay Belanger <jay.p.belanger@gmail.com> |
| 2 | 9 | ||
| 3 | * calc/calc-aent.el (calc-last-user-lang-parse-table): New variable. | 10 | * calc/calc-aent.el (calc-last-user-lang-parse-table): New variable. |
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 321a7f67932..1ac6208313a 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el | |||
| @@ -1578,10 +1578,16 @@ Optional arg HOW-TO is used to set the value of the into-dir variable | |||
| 1578 | "Create a directory called DIRECTORY." | 1578 | "Create a directory called DIRECTORY." |
| 1579 | (interactive | 1579 | (interactive |
| 1580 | (list (read-file-name "Create directory: " (dired-current-directory)))) | 1580 | (list (read-file-name "Create directory: " (dired-current-directory)))) |
| 1581 | (let ((expanded (directory-file-name (expand-file-name directory)))) | 1581 | (let* ((expanded (directory-file-name (expand-file-name directory))) |
| 1582 | (make-directory expanded) | 1582 | (try expanded) new) |
| 1583 | (dired-add-file expanded) | 1583 | ;; Find the topmost nonexistent parent dir (variable `new') |
| 1584 | (dired-move-to-filename))) | 1584 | (while (and try (not (file-exists-p try)) (not (equal new try))) |
| 1585 | (setq new try | ||
| 1586 | try (directory-file-name (file-name-directory try)))) | ||
| 1587 | (make-directory expanded t) | ||
| 1588 | (when new | ||
| 1589 | (dired-add-file new) | ||
| 1590 | (dired-move-to-filename)))) | ||
| 1585 | 1591 | ||
| 1586 | (defun dired-into-dir-with-symlinks (target) | 1592 | (defun dired-into-dir-with-symlinks (target) |
| 1587 | (and (file-directory-p target) | 1593 | (and (file-directory-p target) |