changeset 53189:2c1d6f1a791e

Add variable use-file-dialog to control use of file dialogs.
author Jan Djärv <jan.h.d@swipnet.se>
date Sat, 29 Nov 2003 10:44:36 +0000
parents 84c9b261cac0
children 053a4dfb6bd4
files lisp/ChangeLog lisp/cus-start.el src/ChangeLog src/fileio.c src/fns.c
diffstat 5 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Nov 28 23:07:13 2003 +0000
+++ b/lisp/ChangeLog	Sat Nov 29 10:44:36 2003 +0000
@@ -1,3 +1,7 @@
+2003-11-29  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* cus-start.el (all): Add use-file-dialog.
+
 2003-11-27  Kim F. Storm  <storm@cua.dk>
 
 	* subr.el (posn-object-x-y): New defun.
--- a/lisp/cus-start.el	Fri Nov 28 23:07:13 2003 +0000
+++ b/lisp/cus-start.el	Sat Nov 29 10:44:36 2003 +0000
@@ -123,6 +123,7 @@
 	     (insert-default-directory minibuffer boolean)
 	     ;; fns.c
 	     (use-dialog-box menu boolean "21.1")
+	     (use-file-dialog menu boolean "21.4")
 	     ;; frame.c
 	     (default-frame-alist frames
 	       (repeat (cons :format "%v"
--- a/src/ChangeLog	Fri Nov 28 23:07:13 2003 +0000
+++ b/src/ChangeLog	Sat Nov 29 10:44:36 2003 +0000
@@ -1,3 +1,11 @@
+2003-11-29  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* fileio.c (Fread_file_name): Check use_file_dialog also before
+	calling Fx_file_dialog.
+
+	* fns.c: use_file_dialog: New variable.
+	(syms_of_fns): DEFVAR_BOOL use-file-dialog.
+
 2003-11-29  Kim F. Storm  <storm@cua.dk>
 
 	* msdos.c (Qcursor_type, Qbar, Qhbar): Declare extern.
--- a/src/fileio.c	Fri Nov 28 23:07:13 2003 +0000
+++ b/src/fileio.c	Sat Nov 29 10:44:36 2003 +0000
@@ -134,6 +134,7 @@
 
 #include "commands.h"
 extern int use_dialog_box;
+extern int use_file_dialog;
 
 #ifndef O_WRONLY
 #define O_WRONLY 1
@@ -6212,6 +6213,7 @@
 #if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK)
   if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
       && use_dialog_box
+      && use_file_dialog
       && have_menus_p ())
     {
       /* If DIR contains a file name, split it.  */
--- a/src/fns.c	Fri Nov 28 23:07:13 2003 +0000
+++ b/src/fns.c	Sat Nov 29 10:44:36 2003 +0000
@@ -59,6 +59,10 @@
    asked by mouse commands.  */
 int use_dialog_box;
 
+/* Nonzero enables use of a file dialog for file name
+   questions asked by mouse commands.  */
+int use_file_dialog;
+
 extern int minibuffer_auto_raise;
 extern Lisp_Object minibuf_window;
 extern Lisp_Object Vlocale_coding_system;
@@ -5638,6 +5642,13 @@
 invoked by mouse clicks and mouse menu items.  */);
   use_dialog_box = 1;
 
+  DEFVAR_BOOL ("use-file-dialog", &use_file_dialog,
+    doc: /* *Non-nil means mouse commands use a file dialog to ask for files.
+This applies to commands from menus and tool bar buttons.  The value of
+`use-dialog-box' takes precedence over this variable, so a file dialog is only
+used if both `use-dialog-box' and this variable are non-nil.  */);
+  use_file_dialog = 1;
+  
   defsubr (&Sidentity);
   defsubr (&Srandom);
   defsubr (&Slength);