#endif
#endif
+#include "commands.h"
+extern int use_dialog_box;
+
#ifndef O_WRONLY
#define O_WRONLY 1
#endif
if (! not_regular && st.st_size < 0)
error ("File size is negative");
+ /* Prevent redisplay optimizations. */
+ current_buffer->clip_changed = 1;
+
if (!NILP (beg) || !NILP (end))
if (!NILP (visit))
error ("Attempt to visit less than an entire file");
Lisp_Object tail, buf;
int auto_saved = 0;
char *omessage = echo_area_glyphs;
+ Lisp_Object omessage_string = echo_area_message;
int omessage_length = echo_area_glyphs_length;
int oldmultibyte = message_enable_multibyte;
int do_handled_files;
int count = specpdl_ptr - specpdl;
int *ptr;
int orig_minibuffer_auto_raise = minibuffer_auto_raise;
+ struct gcpro gcpro1;
+ GCPRO1 (omessage_string);
+
/* Ordinarily don't quit within this function,
but don't make it impossible to quit (in case we get hung in I/O). */
oquit = Vquit_flag;
if (auto_saved && NILP (no_message))
{
- if (omessage)
+ if (STRINGP (omessage_string))
+ {
+ sit_for (1, 0, 0, 0, 0);
+ message3 (omessage_string, omessage_length, oldmultibyte);
+ }
+ else if (omessage)
{
sit_for (1, 0, 0, 0, 0);
message2 (omessage, omessage_length, oldmultibyte);
Vquit_flag = oquit;
+ UNGCPRO;
unbind_to (count, Qnil);
return Qnil;
}
specbind (intern ("minibuffer-completing-file-name"), Qt);
GCPRO2 (insdef, default_filename);
- val = Fcompleting_read (prompt, intern ("read-file-name-internal"),
- dir, mustmatch, insdef,
- Qfile_name_history, default_filename, Qnil);
+
+#ifdef USE_MOTIF
+ if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
+ && use_dialog_box
+ && have_menus_p ())
+ {
+ val = Fx_file_dialog (prompt, dir, default_filename, mustmatch);
+ add_to_history = 1;
+ }
+ else
+#endif
+ val = Fcompleting_read (prompt, intern ("read-file-name-internal"),
+ dir, mustmatch, insdef,
+ Qfile_name_history, default_filename, Qnil);
tem = Fsymbol_value (Qfile_name_history);
if (CONSP (tem) && EQ (XCONS (tem)->car, val))
Fset (Qfile_name_history,
Fcons (val1, tem));
}
+
return val;
}
+
\f
void
init_fileio_once ()
XSETFASTINT (Vdirectory_sep_char, '/');
}
+\f
void
syms_of_fileio ()
{