emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103691: Add error for dired-create-d


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103691: Add error for dired-create-directory on existing file (Bug#8246).
Date: Sat, 19 Mar 2011 18:07:41 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103691
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2011-03-19 18:07:41 -0400
message:
  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.
modified:
  lisp/ChangeLog
  lisp/dired-aux.el
  lisp/dired.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-03-19 21:37:21 +0000
+++ b/lisp/ChangeLog    2011-03-19 22:07:41 +0000
@@ -1,5 +1,8 @@
 2011-03-19  Chong Yidong  <address@hidden>
 
+       * 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

=== modified file 'lisp/dired-aux.el'
--- a/lisp/dired-aux.el 2011-02-28 01:31:20 +0000
+++ b/lisp/dired-aux.el 2011-03-19 22:07:41 +0000
@@ -1638,11 +1638,14 @@
 
 ;;;###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

=== modified file 'lisp/dired.el'
--- a/lisp/dired.el     2011-03-05 21:56:00 +0000
+++ b/lisp/dired.el     2011-03-19 22:07:41 +0000
@@ -3627,7 +3627,7 @@
 ;;;;;;  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 @@
 
 (autoload 'dired-create-directory "dired-aux" "\
 Create a directory called DIRECTORY.
+If DIRECTORY already exists, signal an error.
 
 \(fn DIRECTORY)" t nil)
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]