aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann1999-07-21 21:43:52 +0000
committerGerd Moellmann1999-07-21 21:43:52 +0000
commit9c856db9d285755632fb5bb9465cd5bdffe5b319 (patch)
treed92d1719587692a84acfc8a65d3190811ecb7d39 /src
parentd80c6c119996b87138be87a824de964f7b3149b9 (diff)
downloademacs-9c856db9d285755632fb5bb9465cd5bdffe5b319.tar.gz
emacs-9c856db9d285755632fb5bb9465cd5bdffe5b319.zip
(Fdo_auto_save): Handle the case that echo_area_message
is set. (Finsert_file_contents): Prevent redisplay optimizations. (Fread_file_name): Call it. (report_file_error): Return void.
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c38
1 files changed, 34 insertions, 4 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 84defeb05d5..a55e07973cc 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -141,6 +141,9 @@ extern char *strerror ();
141#endif 141#endif
142#endif 142#endif
143 143
144#include "commands.h"
145extern int use_dialog_box;
146
144#ifndef O_WRONLY 147#ifndef O_WRONLY
145#define O_WRONLY 1 148#define O_WRONLY 1
146#endif 149#endif
@@ -3433,6 +3436,9 @@ actually used.")
3433 if (! not_regular && st.st_size < 0) 3436 if (! not_regular && st.st_size < 0)
3434 error ("File size is negative"); 3437 error ("File size is negative");
3435 3438
3439 /* Prevent redisplay optimizations. */
3440 current_buffer->clip_changed = 1;
3441
3436 if (!NILP (beg) || !NILP (end)) 3442 if (!NILP (beg) || !NILP (end))
3437 if (!NILP (visit)) 3443 if (!NILP (visit))
3438 error ("Attempt to visit less than an entire file"); 3444 error ("Attempt to visit less than an entire file");
@@ -5085,6 +5091,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer.")
5085 Lisp_Object tail, buf; 5091 Lisp_Object tail, buf;
5086 int auto_saved = 0; 5092 int auto_saved = 0;
5087 char *omessage = echo_area_glyphs; 5093 char *omessage = echo_area_glyphs;
5094 Lisp_Object omessage_string = echo_area_message;
5088 int omessage_length = echo_area_glyphs_length; 5095 int omessage_length = echo_area_glyphs_length;
5089 int oldmultibyte = message_enable_multibyte; 5096 int oldmultibyte = message_enable_multibyte;
5090 int do_handled_files; 5097 int do_handled_files;
@@ -5094,7 +5101,10 @@ A non-nil CURRENT-ONLY argument means save only current buffer.")
5094 int count = specpdl_ptr - specpdl; 5101 int count = specpdl_ptr - specpdl;
5095 int *ptr; 5102 int *ptr;
5096 int orig_minibuffer_auto_raise = minibuffer_auto_raise; 5103 int orig_minibuffer_auto_raise = minibuffer_auto_raise;
5104 struct gcpro gcpro1;
5097 5105
5106 GCPRO1 (omessage_string);
5107
5098 /* Ordinarily don't quit within this function, 5108 /* Ordinarily don't quit within this function,
5099 but don't make it impossible to quit (in case we get hung in I/O). */ 5109 but don't make it impossible to quit (in case we get hung in I/O). */
5100 oquit = Vquit_flag; 5110 oquit = Vquit_flag;
@@ -5238,7 +5248,12 @@ A non-nil CURRENT-ONLY argument means save only current buffer.")
5238 5248
5239 if (auto_saved && NILP (no_message)) 5249 if (auto_saved && NILP (no_message))
5240 { 5250 {
5241 if (omessage) 5251 if (STRINGP (omessage_string))
5252 {
5253 sit_for (1, 0, 0, 0, 0);
5254 message3 (omessage_string, omessage_length, oldmultibyte);
5255 }
5256 else if (omessage)
5242 { 5257 {
5243 sit_for (1, 0, 0, 0, 0); 5258 sit_for (1, 0, 0, 0, 0);
5244 message2 (omessage, omessage_length, oldmultibyte); 5259 message2 (omessage, omessage_length, oldmultibyte);
@@ -5249,6 +5264,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer.")
5249 5264
5250 Vquit_flag = oquit; 5265 Vquit_flag = oquit;
5251 5266
5267 UNGCPRO;
5252 unbind_to (count, Qnil); 5268 unbind_to (count, Qnil);
5253 return Qnil; 5269 return Qnil;
5254} 5270}
@@ -5485,9 +5501,20 @@ DIR defaults to current buffer's directory default.")
5485 specbind (intern ("minibuffer-completing-file-name"), Qt); 5501 specbind (intern ("minibuffer-completing-file-name"), Qt);
5486 5502
5487 GCPRO2 (insdef, default_filename); 5503 GCPRO2 (insdef, default_filename);
5488 val = Fcompleting_read (prompt, intern ("read-file-name-internal"), 5504
5489 dir, mustmatch, insdef, 5505#ifdef USE_MOTIF
5490 Qfile_name_history, default_filename, Qnil); 5506 if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
5507 && use_dialog_box
5508 && have_menus_p ())
5509 {
5510 val = Fx_file_dialog (prompt, dir, default_filename, mustmatch);
5511 add_to_history = 1;
5512 }
5513 else
5514#endif
5515 val = Fcompleting_read (prompt, intern ("read-file-name-internal"),
5516 dir, mustmatch, insdef,
5517 Qfile_name_history, default_filename, Qnil);
5491 5518
5492 tem = Fsymbol_value (Qfile_name_history); 5519 tem = Fsymbol_value (Qfile_name_history);
5493 if (CONSP (tem) && EQ (XCONS (tem)->car, val)) 5520 if (CONSP (tem) && EQ (XCONS (tem)->car, val))
@@ -5540,8 +5567,10 @@ DIR defaults to current buffer's directory default.")
5540 Fset (Qfile_name_history, 5567 Fset (Qfile_name_history,
5541 Fcons (val1, tem)); 5568 Fcons (val1, tem));
5542 } 5569 }
5570
5543 return val; 5571 return val;
5544} 5572}
5573
5545 5574
5546void 5575void
5547init_fileio_once () 5576init_fileio_once ()
@@ -5550,6 +5579,7 @@ init_fileio_once ()
5550 XSETFASTINT (Vdirectory_sep_char, '/'); 5579 XSETFASTINT (Vdirectory_sep_char, '/');
5551} 5580}
5552 5581
5582
5553void 5583void
5554syms_of_fileio () 5584syms_of_fileio ()
5555{ 5585{