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
\f
;;;###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
;;;;;; 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" "\
(autoload 'dired-create-directory "dired-aux" "\
Create a directory called DIRECTORY.
+If DIRECTORY already exists, signal an error.
\(fn DIRECTORY)" t nil)