Commit ff854b0b authored by Chong Yidong's avatar Chong Yidong
Browse files

Add error for dired-create-directory on existing file (Bug#8246).

* lisp/dired-aux.el (dired-create-directory): Signal an error if the
directory already exists.
parent fe0fb33e
2011-03-19 Chong Yidong <cyd@stupidchicken.com>
 
* dired-aux.el (dired-create-directory): Signal an error if the
directory already exists (Bug#8246).
* facemenu.el (list-colors-display): Call list-faces-display
inside with-help-window.
(list-colors-print): Use display property to align the final
......
......@@ -1638,11 +1638,14 @@ Optional arg HOW-TO determiness how to treat the target.
;;;###autoload
(defun dired-create-directory (directory)
"Create a directory called DIRECTORY."
"Create a directory called DIRECTORY.
If DIRECTORY already exists, signal an error."
(interactive
(list (read-file-name "Create directory: " (dired-current-directory))))
(let* ((expanded (directory-file-name (expand-file-name directory)))
(try expanded) new)
(if (file-exists-p expanded)
(error "Cannot create directory %s: file exists" expanded))
;; Find the topmost nonexistent parent dir (variable `new')
(while (and try (not (file-exists-p try)) (not (equal new try)))
(setq new try
......
......@@ -3627,7 +3627,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command
;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown
;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff
;;;;;; dired-diff) "dired-aux" "dired-aux.el" "154cdfbf451aedec60c5012b625ff329")
;;;;;; dired-diff) "dired-aux" "dired-aux.el" "2d805d6766bd7970cd446413b4ed4ce0")
;;; Generated autoloads from dired-aux.el
(autoload 'dired-diff "dired-aux" "\
......@@ -3858,6 +3858,7 @@ Not documented
(autoload 'dired-create-directory "dired-aux" "\
Create a directory called DIRECTORY.
If DIRECTORY already exists, signal an error.
\(fn DIRECTORY)" t nil)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment