- ;; this calls read-file-name-2
- (mouse-read-file-name-1 history prompt dir default must-match
- initial-contents completer)
+ (condition-case nil
+ (let ((file
+ (apply #'make-dialog-box
+ type `(:title ,(capitalize-string-as-title
+ ;; Kludge: Delete ": " off the end.
+ (replace-in-string prompt ": $" ""))
+ ,@(and dir (list :initial-directory
+ dir))
+ :file-must-exist ,must-match
+ ,@(and initial-contents
+ (list :initial-filename
+ initial-contents))))))
+ ;; hack -- until we implement reading a directory properly,
+ ;; allow a file as indicating the directory it's in
+ (if (and (eq completer 'read-directory-name-internal)
+ (not (file-directory-p file)))
+ (file-name-directory file)
+ file))
+ (unimplemented
+ ;; this calls read-file-name-2
+ (mouse-read-file-name-1 history prompt dir default must-match
+ initial-contents completer)
+ ))