diff options
Diffstat (limited to 'lisp/dired.el')
-rw-r--r-- | lisp/dired.el | 10 |
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 |