diff options
| author | Eli Zaretskii | 2000-08-08 10:51:51 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2000-08-08 10:51:51 +0000 |
| commit | 325fec3c5a7770f3bac3a481b11b58811a87ccb0 (patch) | |
| tree | f56c120726a5fa4ca5113d1335ba23effcc5ecc9 | |
| parent | 0a6b8ff7302fc17e11656cc85cac90c77cc81645 (diff) | |
| download | emacs-325fec3c5a7770f3bac3a481b11b58811a87ccb0.tar.gz emacs-325fec3c5a7770f3bac3a481b11b58811a87ccb0.zip | |
(dired-do-create-files): On DOS/Windows, allow to
rename a directory to a name that differs only by its letter case.
| -rw-r--r-- | lisp/dired-aux.el | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 8ff4128350d..4a2d8932457 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el | |||
| @@ -1232,7 +1232,25 @@ ESC or `q' to not overwrite any of the remaining files, | |||
| 1232 | (concat (if dired-one-file op1 operation) " %s to: ") | 1232 | (concat (if dired-one-file op1 operation) " %s to: ") |
| 1233 | (dired-dwim-target-directory) | 1233 | (dired-dwim-target-directory) |
| 1234 | op-symbol arg rfn-list))) | 1234 | op-symbol arg rfn-list))) |
| 1235 | (into-dir (cond ((null how-to) (file-directory-p target)) | 1235 | (into-dir (cond ((null how-to) |
| 1236 | ;; Allow DOS/Windows users to change the letter | ||
| 1237 | ;; case of a directory. If we don't test these | ||
| 1238 | ;; conditions up front, file-directory-p below | ||
| 1239 | ;; will return t because the filesystem is | ||
| 1240 | ;; case-insensitive, and Emacs will try to move | ||
| 1241 | ;; foo -> foo/foo, which fails. | ||
| 1242 | (if (and (memq system-type '(ms-dos windows-nt)) | ||
| 1243 | (eq op-symbol 'move) | ||
| 1244 | dired-one-file | ||
| 1245 | (string= (downcase | ||
| 1246 | (expand-file-name (car fn-list))) | ||
| 1247 | (downcase | ||
| 1248 | (expand-file-name target))) | ||
| 1249 | (not (string= | ||
| 1250 | (file-name-nondirectory (car fn-list)) | ||
| 1251 | (file-name-nondirectory target)))) | ||
| 1252 | nil | ||
| 1253 | (file-directory-p target))) | ||
| 1236 | ((eq how-to t) nil) | 1254 | ((eq how-to t) nil) |
| 1237 | (t (funcall how-to target))))) | 1255 | (t (funcall how-to target))))) |
| 1238 | (if (and (consp into-dir) (functionp (car into-dir))) | 1256 | (if (and (consp into-dir) (functionp (car into-dir))) |