diff options
| author | Jan Djärv | 2004-11-04 15:19:49 +0000 |
|---|---|---|
| committer | Jan Djärv | 2004-11-04 15:19:49 +0000 |
| commit | 88208bb85c778985d26a5990bf03980ba71e4b9d (patch) | |
| tree | 043c4eedbcb75220ef1fd67070f17ecf85860653 /src | |
| parent | 0a4f23f30e353cbe4c85cef460eca779a2553037 (diff) | |
| download | emacs-88208bb85c778985d26a5990bf03980ba71e4b9d.tar.gz emacs-88208bb85c778985d26a5990bf03980ba71e4b9d.zip | |
* fileio.c (Fnext_read_file_uses_dialog_p): New function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 2 | ||||
| -rw-r--r-- | src/fileio.c | 23 |
2 files changed, 21 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 0921957b577..1c0f23196aa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2004-11-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 1 | 2004-11-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 2 | 2 | ||
| 3 | * fileio.c (Fnext_read_file_uses_dialog_p): New function. | ||
| 4 | |||
| 3 | * gtkutil.h: Declare use_old_gtk_file_dialog. | 5 | * gtkutil.h: Declare use_old_gtk_file_dialog. |
| 4 | 6 | ||
| 5 | * gtkutil.c: Make use_old_gtk_file_dialog non-static. | 7 | * gtkutil.c: Make use_old_gtk_file_dialog non-static. |
diff --git a/src/fileio.c b/src/fileio.c index 68ca97cf57f..4b5f4942566 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -6174,6 +6174,23 @@ DEFUN ("read-file-name-internal", Fread_file_name_internal, Sread_file_name_inte | |||
| 6174 | return Ffile_exists_p (string); | 6174 | return Ffile_exists_p (string); |
| 6175 | } | 6175 | } |
| 6176 | 6176 | ||
| 6177 | DEFUN ("next-read-file-uses-dialog-p", Fnext_read_file_uses_dialog_p, | ||
| 6178 | Snext_read_file_uses_dialog_p, 0, 0, 0, | ||
| 6179 | doc: /* Return t if a call to `read-file-name' will use a dialog. | ||
| 6180 | The return value is only relevant for a call to `read-file-name' that happens | ||
| 6181 | before any other event (mouse or keypress) is handeled. */) | ||
| 6182 | () | ||
| 6183 | { | ||
| 6184 | #if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) || defined (TARGET_API_MAC_CARBON) | ||
| 6185 | if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) | ||
| 6186 | && use_dialog_box | ||
| 6187 | && use_file_dialog | ||
| 6188 | && have_menus_p ()) | ||
| 6189 | return Qt; | ||
| 6190 | #endif | ||
| 6191 | return Qnil; | ||
| 6192 | } | ||
| 6193 | |||
| 6177 | DEFUN ("read-file-name", Fread_file_name, Sread_file_name, 1, 6, 0, | 6194 | DEFUN ("read-file-name", Fread_file_name, Sread_file_name, 1, 6, 0, |
| 6178 | doc: /* Read file name, prompting with PROMPT and completing in directory DIR. | 6195 | doc: /* Read file name, prompting with PROMPT and completing in directory DIR. |
| 6179 | Value is not expanded---you must call `expand-file-name' yourself. | 6196 | Value is not expanded---you must call `expand-file-name' yourself. |
| @@ -6306,10 +6323,7 @@ and `read-file-name-function'. */) | |||
| 6306 | GCPRO2 (insdef, default_filename); | 6323 | GCPRO2 (insdef, default_filename); |
| 6307 | 6324 | ||
| 6308 | #if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) || defined (TARGET_API_MAC_CARBON) | 6325 | #if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) || defined (TARGET_API_MAC_CARBON) |
| 6309 | if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) | 6326 | if (! NILP (Fnext_read_file_uses_dialog_p ())) |
| 6310 | && use_dialog_box | ||
| 6311 | && use_file_dialog | ||
| 6312 | && have_menus_p ()) | ||
| 6313 | { | 6327 | { |
| 6314 | /* If DIR contains a file name, split it. */ | 6328 | /* If DIR contains a file name, split it. */ |
| 6315 | Lisp_Object file; | 6329 | Lisp_Object file; |
| @@ -6694,6 +6708,7 @@ a non-nil value. */); | |||
| 6694 | 6708 | ||
| 6695 | defsubr (&Sread_file_name_internal); | 6709 | defsubr (&Sread_file_name_internal); |
| 6696 | defsubr (&Sread_file_name); | 6710 | defsubr (&Sread_file_name); |
| 6711 | defsubr (&Snext_read_file_uses_dialog_p); | ||
| 6697 | 6712 | ||
| 6698 | #ifdef unix | 6713 | #ifdef unix |
| 6699 | defsubr (&Sunix_sync); | 6714 | defsubr (&Sunix_sync); |