[Openmcl-cvs-notifications] r11868 - /trunk/source/lib/misc.lisp

gb at clozure.com gb at clozure.com
Tue Mar 31 06:49:14 EDT 2009


Author: gb
Date: Tue Mar 31 06:49:14 2009
New Revision: 11868

Log:
Add *CHOOSE-FILE-DIALOG-HOOK* to skeletal
CHOOSE-FILE-DIALOG/CHOOSE-NEW-FILE-DIALOG, so that versions that actually
have a UI can be called.

Modified:
    trunk/source/lib/misc.lisp

Modified: trunk/source/lib/misc.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lib/misc.lisp (original)
+++ trunk/source/lib/misc.lisp Tue Mar 31 06:49:14 2009
@@ -694,16 +694,24 @@
 			    (< value (length list)))
 		       (return-from get-answer (list (nth value list))))))))))))
 =

+(defvar *choose-file-dialog-hook* nil "for GUIs")
+
 ;;; There should ideally be some way to override the UI (such as
 ;;; it is ...) here.
 ;;; More generally, this either
 ;;;   a) shouldn't exist, or
 ;;;   b) should do more sanity-checking
 (defun choose-file-dialog (&key file-types (prompt "File name:"))
-  (%choose-file-dialog t prompt file-types))
+  (let* ((hook *choose-file-dialog-hook*))
+    (if hook
+      (funcall hook t prompt file-types)
+      (%choose-file-dialog t prompt file-types))))
 =

 (defun choose-new-file-dialog (&key prompt)
-  (%choose-file-dialog nil prompt nil))
+  (let* ((hook *choose-file-dialog-hook*))
+    (if hook
+      (funcall hook nil prompt nil)
+      (%choose-file-dialog nil prompt nil))))
 =

 (defun %choose-file-dialog (must-exist prompt file-types)
   (loop



More information about the Openmcl-cvs-notifications mailing list