diff lisp/dired.el @ 57943:e4c39a455af0

* dired.el (dired-read-dir-and-switches): Call read-directory-name if a dialog will be used, read-file-name otherwise.
author Jan Djärv <jan.h.d@swipnet.se>
date Thu, 04 Nov 2004 15:22:00 +0000
parents 5a547995da89
children b9a1c1b8d195 cb7f41387eb3
line wrap: on
line diff
--- a/lisp/dired.el	Thu Nov 04 15:19:49 2004 +0000
+++ b/lisp/dired.el	Thu Nov 04 15:22:00 2004 +0000
@@ -546,8 +546,14 @@
 	    (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