summaryrefslogtreecommitdiff
path: root/lisp/dired.el
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2004-11-04 15:22:00 +0000
committerJan Djärv <jan.h.d@swipnet.se>2004-11-04 15:22:00 +0000
commit8d9e2a494025f771da16061f4ef3562a8e4578b0 (patch)
tree16a03e2e27b39cfbafb3508a6b2a2bc76a324e0b /lisp/dired.el
parent88208bb85c778985d26a5990bf03980ba71e4b9d (diff)
downloademacs-8d9e2a494025f771da16061f4ef3562a8e4578b0.tar.gz
* dired.el (dired-read-dir-and-switches): Call read-directory-name
if a dialog will be used, read-file-name otherwise.
Diffstat (limited to 'lisp/dired.el')
-rw-r--r--lisp/dired.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index c0fc33729c2..4553683b181 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -546,8 +546,14 @@ Optional third argument FILTER, if non-nil, is a function to select
(if current-prefix-arg
(read-string "Dired listing switches: "
dired-listing-switches))
- (read-directory-name (format "Dired %s(directory): " str)
- nil default-directory nil))))
+ ;; If a dialog is about to be used, call read-directory-name so
+ ;; the dialog code knows we want directories. Some dialogs can
+ ;; only select directories or files when popped up, not both.
+ (if (next-read-file-uses-dialog-p)
+ (read-directory-name (format "Dired %s(directory): " str)
+ nil default-directory nil)
+ (read-file-name (format "Dired %s(directory): " str)
+ nil default-directory nil)))))
;;;###autoload (define-key ctl-x-map "d" 'dired)
;;;###autoload